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/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/database.test2
-rw-r--r--mysql-test/extra/binlog_tests/mysqlbinlog_row_engine.inc3
-rw-r--r--mysql-test/extra/rpl_tests/rpl_auto_increment.test1
-rw-r--r--mysql-test/extra/rpl_tests/rpl_ddl.test9
-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_implicit_commit_binlog.test290
-rw-r--r--mysql-test/extra/rpl_tests/rpl_innodb.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_loadfile.test4
-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_partition.test4
-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_sv_relay_space.test2
-rw-r--r--mysql-test/extra/rpl_tests/rpl_trig004.test6
-rw-r--r--mysql-test/include/binlog_start_pos.inc10
-rw-r--r--mysql-test/include/check-testcase.test3
-rw-r--r--mysql-test/include/check-warnings.test4
-rw-r--r--mysql-test/include/concurrent.inc2
-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_utf8_ilseq.inc18
-rw-r--r--mysql-test/include/ctype_utf8mb4.inc73
-rw-r--r--mysql-test/include/default_mysqld.cnf2
-rw-r--r--mysql-test/include/default_ndbd.cnf27
-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/func_hybrid_type.inc81
-rw-r--r--mysql-test/include/galera_cluster.inc10
-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/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/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.sql4
-rw-r--r--mysql-test/include/mtr_warnings.sql7
-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/restart_mysqld.inc9
-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/search_pattern_in_file.inc15
-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_events2.inc2
-rw-r--r--mysql-test/include/show_events.inc16
-rw-r--r--mysql-test/include/show_relaylog_events.inc3
-rw-r--r--mysql-test/include/sync_slave_sql_with_master.inc53
-rw-r--r--mysql-test/include/sync_with_master_gtid.inc4
-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_until_ready.inc34
-rw-r--r--mysql-test/include/word_size.combinations3
-rw-r--r--mysql-test/include/word_size.inc4
-rw-r--r--mysql-test/lib/My/ConfigFactory.pm156
-rw-r--r--mysql-test/lib/My/SafeProcess/safe_process.cc22
-rw-r--r--mysql-test/lib/mtr_cases.pm40
-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.pl510
-rw-r--r--mysql-test/r/alter_table.result33
-rw-r--r--mysql-test/r/alter_table_online.result114
-rw-r--r--mysql-test/r/analyze.result2
-rw-r--r--mysql-test/r/analyze_format_json.result765
-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.result15
-rw-r--r--mysql-test/r/auth_named_pipe.result10
-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.result69
-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.result14
-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_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.result201
-rw-r--r--mysql-test/r/ctype_uca_innodb.result38
-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.result10
-rw-r--r--mysql-test/r/ctype_utf16.result94
-rw-r--r--mysql-test/r/ctype_utf16_uca.result16
-rw-r--r--mysql-test/r/ctype_utf16le.result94
-rw-r--r--mysql-test/r/ctype_utf32.result51
-rw-r--r--mysql-test/r/ctype_utf32_uca.result16
-rw-r--r--mysql-test/r/ctype_utf8.result569
-rw-r--r--mysql-test/r/ctype_utf8mb4.result144
-rw-r--r--mysql-test/r/ctype_utf8mb4_heap.result135
-rw-r--r--mysql-test/r/ctype_utf8mb4_innodb.result137
-rw-r--r--mysql-test/r/ctype_utf8mb4_myisam.result137
-rw-r--r--mysql-test/r/ctype_utf8mb4_uca.result2
-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/delete_returning_grant.result3
-rw-r--r--mysql-test/r/derived.result46
-rw-r--r--mysql-test/r/derived_view.result10
-rw-r--r--mysql-test/r/distinct.result22
-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/engine_error_in_alter-8453.result6
-rw-r--r--mysql-test/r/events_1.result1
-rw-r--r--mysql-test/r/events_2.result5
-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.result5
-rw-r--r--mysql-test/r/func_encrypt.result18
-rw-r--r--mysql-test/r/func_group.result65
-rw-r--r--mysql-test/r/func_hybrid_type.result3400
-rw-r--r--mysql-test/r/func_if.result5
-rw-r--r--mysql-test/r/func_in.result30
-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.result10
-rw-r--r--mysql-test/r/func_set.result8
-rw-r--r--mysql-test/r/func_str.result244
-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.result100
-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-alter_table_online.result51
-rw-r--r--mysql-test/r/gis-debug.result2
-rw-r--r--mysql-test/r/gis-precise.result15
-rw-r--r--mysql-test/r/gis-rtree.result48
-rw-r--r--mysql-test/r/gis.result223
-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.result92
-rw-r--r--mysql-test/r/group_min_max.result160
-rw-r--r--mysql-test/r/handlersocket.result2
-rw-r--r--mysql-test/r/have_mutex_deadlock_detector.require2
-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/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.result105
-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.result2
-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/join_cache.result65
-rw-r--r--mysql-test/r/join_outer.result32
-rw-r--r--mysql-test/r/join_outer_jcl6.result32
-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/lock_multi.result2
-rw-r--r--mysql-test/r/log_slow.result1
-rw-r--r--mysql-test/r/log_state.result17
-rw-r--r--mysql-test/r/log_tables.result44
-rw-r--r--mysql-test/r/lowercase_fs_off.result3
-rw-r--r--mysql-test/r/lowercase_fs_on.result1
-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/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_tzinfo_to_sql_symlink.result20
-rw-r--r--mysql-test/r/mysql_upgrade.result62
-rw-r--r--mysql-test/r/mysql_upgrade_view.result1
-rw-r--r--mysql-test/r/mysqlbinlog-innodb.result4
-rw-r--r--mysql-test/r/mysqlbinlog.result20
-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.result62
-rw-r--r--mysql-test/r/mysqld--help,win.rdiff65
-rw-r--r--mysql-test/r/mysqld--help.result269
-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.result219
-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.result1144
-rw-r--r--mysql-test/r/old-mode.result13
-rw-r--r--mysql-test/r/openssl_1.result3
-rw-r--r--mysql-test/r/openssl_6975,tlsv10.result2
-rw-r--r--mysql-test/r/openssl_6975,tlsv12.result2
-rw-r--r--mysql-test/r/order_by.result44
-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_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_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/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.result75
-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/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.result85
-rw-r--r--mysql-test/r/range_mrr_icp.result85
-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.result7
-rw-r--r--mysql-test/r/row.result22
-rw-r--r--mysql-test/r/select.result13
-rw-r--r--mysql-test/r/select_jcl6.result13
-rw-r--r--mysql-test/r/select_pkeycache.result13
-rw-r--r--mysql-test/r/selectivity.result18
-rw-r--r--mysql-test/r/selectivity_innodb.result12
-rw-r--r--mysql-test/r/servers.result20
-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.result14
-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/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.result96
-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/stack-crash.result10
-rw-r--r--mysql-test/r/stat_tables_rbr.result25
-rw-r--r--mysql-test/r/statistics.result26
-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/strict.result24
-rw-r--r--mysql-test/r/subselect.result46
-rw-r--r--mysql-test/r/subselect2.result4
-rw-r--r--mysql-test/r/subselect4.result4
-rw-r--r--mysql-test/r/subselect_cache.result225
-rw-r--r--mysql-test/r/subselect_innodb.result2
-rw-r--r--mysql-test/r/subselect_mat.result21
-rw-r--r--mysql-test/r/subselect_no_exists_to_in.result46
-rw-r--r--mysql-test/r/subselect_no_mat.result46
-rw-r--r--mysql-test/r/subselect_no_opts.result46
-rw-r--r--mysql-test/r/subselect_no_scache.result46
-rw-r--r--mysql-test/r/subselect_no_semijoin.result46
-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.result6
-rw-r--r--mysql-test/r/symlink.result3
-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.result28
-rw-r--r--mysql-test/r/trigger_notembedded.result15
-rw-r--r--mysql-test/r/trigger_null-8605.result343
-rw-r--r--mysql-test/r/truncate.result2
-rw-r--r--mysql-test/r/type_blob.result8
-rw-r--r--mysql-test/r/type_date.result360
-rw-r--r--mysql-test/r/type_datetime.result317
-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.result163
-rw-r--r--mysql-test/r/type_num.result1222
-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_time.result824
-rw-r--r--mysql-test/r/type_time_6065.result48
-rw-r--r--mysql-test/r/type_timestamp.result256
-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.result44
-rw-r--r--mysql-test/r/union.result230
-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/userstat.result (renamed from mysql-test/r/status_user.result)24
-rw-r--r--mysql-test/r/varbinary.result4
-rw-r--r--mysql-test/r/variables-notembedded.result43
-rw-r--r--mysql-test/r/variables.result30
-rw-r--r--mysql-test/r/view.result121
-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/binlog-header.logbin0 -> 120 bytes
-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.txt6
-rw-r--r--mysql-test/std_data/keys3.txt7
-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
-rwxr-xr-xmysql-test/std_data/wsrep_notify.sh99
-rw-r--r--mysql-test/suite.pm13
-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_grant.result1
-rw-r--r--mysql-test/suite/binlog/r/binlog_innodb_row.result3
-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_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/t/binlog_grant.test1
-rw-r--r--mysql-test/suite/binlog/t/binlog_index.test6
-rw-r--r--mysql-test/suite/binlog/t/binlog_multi_engine.test110
-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_row_annotate.test2
-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/csv/csv.result54
-rw-r--r--mysql-test/suite/csv/csv.test43
-rw-r--r--mysql-test/suite/encryption/disabled.def17
-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/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.result21
-rw-r--r--mysql-test/suite/encryption/r/encrypt_and_grep.result42
-rw-r--r--mysql-test/suite/encryption/r/encryption_force.result60
-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_unencfile.result9
-rw-r--r--mysql-test/suite/encryption/r/innochecksum.result23
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change.result136
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change2.result26
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change3.result44
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change4.result20
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-change5.result28
-rw-r--r--mysql-test/suite/encryption/r/innodb-bad-key-shutdown.result20
-rw-r--r--mysql-test/suite/encryption/r/innodb-discard-import.result144
-rw-r--r--mysql-test/suite/encryption/r/innodb-encr-threads.result7
-rw-r--r--mysql-test/suite/encryption/r/innodb-encryption-alter.result53
-rw-r--r--mysql-test/suite/encryption/r/innodb-encryption-disable.result32
-rw-r--r--mysql-test/suite/encryption/r/innodb-log-encrypt.result55
-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.result184
-rw-r--r--mysql-test/suite/encryption/r/innodb-page_encryption_log_encryption.result249
-rw-r--r--mysql-test/suite/encryption/r/innodb_encryption-page-compression.result264
-rw-r--r--mysql-test/suite/encryption/r/innodb_encryption.result57
-rw-r--r--mysql-test/suite/encryption/r/innodb_encryption_discard_import.result149
-rw-r--r--mysql-test/suite/encryption/r/innodb_encryption_filekeys.result67
-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_onlinealter_encryption.result176
-rw-r--r--mysql-test/suite/encryption/r/innodb_page_encryption_key_change.result153
-rw-r--r--mysql-test/suite/encryption/r/innodb_scrub.result224
-rw-r--r--mysql-test/suite/encryption/r/innodb_scrub_background.result81
-rw-r--r--mysql-test/suite/encryption/r/innodb_scrub_compressed.result71
-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.test24
-rw-r--r--mysql-test/suite/encryption/t/encrypt_and_grep.opt8
-rw-r--r--mysql-test/suite/encryption/t/encrypt_and_grep.test108
-rw-r--r--mysql-test/suite/encryption/t/encryption_force.opt2
-rw-r--r--mysql-test/suite/encryption/t/encryption_force.test41
-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_badtest.inc18
-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.inc20
-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_unencfile.opt2
-rw-r--r--mysql-test/suite/encryption/t/filekeys_unencfile.test2
-rw-r--r--mysql-test/suite/encryption/t/innochecksum.test101
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change.test122
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change2.test59
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change3.test114
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change4.test89
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change5.opt4
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-change5.test88
-rw-r--r--mysql-test/suite/encryption/t/innodb-bad-key-shutdown.test68
-rw-r--r--mysql-test/suite/encryption/t/innodb-discard-import.test167
-rw-r--r--mysql-test/suite/encryption/t/innodb-encr-threads.test14
-rw-r--r--mysql-test/suite/encryption/t/innodb-encryption-alter.test98
-rw-r--r--mysql-test/suite/encryption/t/innodb-encryption-disable.test92
-rw-r--r--mysql-test/suite/encryption/t/innodb-log-encrypt.opt6
-rw-r--r--mysql-test/suite/encryption/t/innodb-log-encrypt.test112
-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.test131
-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.test168
-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.test169
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption.opt8
-rw-r--r--mysql-test/suite/encryption/t/innodb_encryption.test176
-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.test233
-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_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_onlinealter_encryption.opt8
-rw-r--r--mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test191
-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.test156
-rw-r--r--mysql-test/suite/encryption/t/innodb_scrub_background.opt9
-rw-r--r--mysql-test/suite/encryption/t/innodb_scrub_background.test164
-rw-r--r--mysql-test/suite/encryption/t/innodb_scrub_compressed.opt9
-rw-r--r--mysql-test/suite/encryption/t/innodb_scrub_compressed.test161
-rw-r--r--mysql-test/suite/encryption/t/tempfiles.test74
-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/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/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.result12
-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.result6
-rw-r--r--mysql-test/suite/funcs_1/r/is_columns_mysql_embedded.result6
-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_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/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.def29
-rw-r--r--mysql-test/suite/galera/galera_2nodes.cnf40
-rw-r--r--mysql-test/suite/galera/galera_2nodes_as_master.cnf70
-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/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.inc23
-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/basic.result30
-rw-r--r--mysql-test/suite/galera/r/binlog_checksum.result36
-rw-r--r--mysql-test/suite/galera/r/create.result61
-rw-r--r--mysql-test/suite/galera/r/enforce_storage_engine.result22
-rw-r--r--mysql-test/suite/galera/r/fk.result96
-rw-r--r--mysql-test/suite/galera/r/galera_account_management.result40
-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.result48
-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_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.result14
-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_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.result55
-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_defaults.result120
-rw-r--r--mysql-test/suite/galera/r/galera_delete_limit.result19
-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.result54
-rw-r--r--mysql-test/suite/galera/r/galera_forced_binlog_format.result18
-rw-r--r--mysql-test/suite/galera/r/galera_ftwrl.result16
-rw-r--r--mysql-test/suite/galera/r/galera_ftwrl_drain.result24
-rw-r--r--mysql-test/suite/galera/r/galera_fulltext.result26
-rw-r--r--mysql-test/suite/galera/r/galera_gcs_fc_limit.result17
-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_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.result284
-rw-r--r--mysql-test/suite/galera/r/galera_ist_restart_joiner.result43
-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.result11
-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.result58
-rw-r--r--mysql-test/suite/galera/r/galera_log_output_csv.result21
-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.result20
-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.result27
-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_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.result8
-rw-r--r--mysql-test/suite/galera/r/galera_restart_nochanges.result9
-rw-r--r--mysql-test/suite/galera/r/galera_roles.result156
-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_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_split_brain.result5
-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.result24
-rw-r--r--mysql-test/suite/galera/r/galera_sst_mysqldump.result459
-rw-r--r--mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result106
-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.result358
-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.result10
-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_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_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_transaction_read_only.result21
-rw-r--r--mysql-test/suite/galera/r/galera_transaction_replay.result30
-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.result21
-rw-r--r--mysql-test/suite/galera/r/galera_var_cluster_address.result51
-rw-r--r--mysql-test/suite/galera/r/galera_var_desync_on.result29
-rw-r--r--mysql-test/suite/galera/r/galera_var_dirty_reads.result25
-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_size.result8
-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.result9
-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.result78
-rw-r--r--mysql-test/suite/galera/r/galera_var_slave_threads.result114
-rw-r--r--mysql-test/suite/galera/r/galera_var_sync_wait.result21
-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_new_cluster.result36
-rw-r--r--mysql-test/suite/galera/r/galera_wsrep_provider_unset_set.result13
-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/lp1438990.result21
-rw-r--r--mysql-test/suite/galera/r/lp959512.result24
-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#33.result103
-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/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.result52
-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.pm77
-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.test58
-rw-r--r--mysql-test/suite/galera/t/enforce_storage_engine.test33
-rw-r--r--mysql-test/suite/galera/t/fk.test116
-rw-r--r--mysql-test/suite/galera/t/galera_account_management.test101
-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.test62
-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_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.test95
-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.cnf13
-rw-r--r--mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.test95
-rw-r--r--mysql-test/suite/galera/t/galera_bf_abort.test29
-rw-r--r--mysql-test/suite/galera/t/galera_bf_abort_flush_for_export.test40
-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_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.test57
-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_defaults.test71
-rw-r--r--mysql-test/suite/galera/t/galera_delete_limit.test52
-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.test173
-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.test25
-rw-r--r--mysql-test/suite/galera/t/galera_ftwrl.test40
-rw-r--r--mysql-test/suite/galera/t/galera_ftwrl_drain.test68
-rw-r--r--mysql-test/suite/galera/t/galera_fulltext.test62
-rw-r--r--mysql-test/suite/galera/t/galera_gcs_fc_limit.test56
-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_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.cnf11
-rw-r--r--mysql-test/suite/galera/t/galera_ist_mysqldump.test17
-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.test106
-rw-r--r--mysql-test/suite/galera/t/galera_ist_rsync.cnf11
-rw-r--r--mysql-test/suite/galera/t/galera_ist_rsync.test8
-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.test39
-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.test35
-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.test27
-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.test104
-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.test45
-rw-r--r--mysql-test/suite/galera/t/galera_pc_ignore_sb.test49
-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.opt3
-rw-r--r--mysql-test/suite/galera/t/galera_query_cache.test67
-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.test25
-rw-r--r--mysql-test/suite/galera/t/galera_restart_nochanges.test39
-rw-r--r--mysql-test/suite/galera/t/galera_roles.test167
-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_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_split_brain.test53
-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.test24
-rw-r--r--mysql-test/suite/galera/t/galera_ssl_compression.cnf7
-rw-r--r--mysql-test/suite/galera/t/galera_ssl_compression.test34
-rw-r--r--mysql-test/suite/galera/t/galera_ssl_upgrade.cnf7
-rw-r--r--mysql-test/suite/galera/t/galera_ssl_upgrade.test46
-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.test22
-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.test9
-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.test66
-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_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_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_transaction_read_only.test58
-rw-r--r--mysql-test/suite/galera/t/galera_transaction_replay.test71
-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.test39
-rw-r--r--mysql-test/suite/galera/t/galera_var_cluster_address.test110
-rw-r--r--mysql-test/suite/galera/t/galera_var_desync_on.test58
-rw-r--r--mysql-test/suite/galera/t/galera_var_dirty_reads.test62
-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_size.test23
-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.test22
-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.test139
-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.test43
-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.test148
-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_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_unset_set.test41
-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/lp1438990.test38
-rw-r--r--mysql-test/suite/galera/t/lp959512.test26
-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#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/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.test44
-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.def5
-rw-r--r--mysql-test/suite/galera_3nodes/galera_3nodes.cnf60
-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/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_innobackupex_backup.result11
-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.result29
-rw-r--r--mysql-test/suite/galera_3nodes/r/galera_pc_weight.result119
-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/suite.pm53
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_certification_ccc.test60
-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_innobackupex_backup.test58
-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.test98
-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.test90
-rw-r--r--mysql-test/suite/galera_3nodes/t/galera_pc_weight.test123
-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/innodb/include/innodb_simulate_comp_failures.inc15
-rw-r--r--mysql-test/suite/innodb/r/binlog_consistent.result75
-rw-r--r--mysql-test/suite/innodb/r/data_types.result6
-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_no_optimize_thread.result6
-rw-r--r--mysql-test/suite/innodb/r/innochecksum.result9
-rw-r--r--mysql-test/suite/innodb/r/innodb-16k.result979
-rw-r--r--mysql-test/suite/innodb/r/innodb-32k-crash.result291
-rw-r--r--mysql-test/suite/innodb/r/innodb-32k.result868
-rw-r--r--mysql-test/suite/innodb/r/innodb-64k-crash.result593
-rw-r--r--mysql-test/suite/innodb/r/innodb-64k.result1139
-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-change-buffer-recovery.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb-flush-changed-page-bitmaps.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb-get-fk.result4
-rw-r--r--mysql-test/suite/innodb/r/innodb-index.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result437
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_lz4.result438
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_lzma.result437
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_lzo.result351
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_snappy.result438
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_tables.result121
-rw-r--r--mysql-test/suite/innodb/r/innodb-page_compression_zip.result351
-rw-r--r--mysql-test/suite/innodb/r/innodb-update-insert.result4
-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.result11
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug21704.result6
-rw-r--r--mysql-test/suite/innodb/r/innodb_bug59641.result4
-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.result125
-rw-r--r--mysql-test/suite/innodb/r/innodb_defragment_fill_factor.result76
-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_monitor.result30
-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.result393
-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.result6
-rw-r--r--mysql-test/suite/innodb/t/binlog_consistent.test17
-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_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.test977
-rw-r--r--mysql-test/suite/innodb/t/innodb-32k-crash-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb-32k-crash.test222
-rw-r--r--mysql-test/suite/innodb/t/innodb-32k-master.opt3
-rw-r--r--mysql-test/suite/innodb/t/innodb-32k.test769
-rw-r--r--mysql-test/suite/innodb/t/innodb-64k-crash-master.opt1
-rw-r--r--mysql-test/suite/innodb/t/innodb-64k-crash.test412
-rw-r--r--mysql-test/suite/innodb/t/innodb-64k-master.opt3
-rw-r--r--mysql-test/suite/innodb/t/innodb-64k.test723
-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.test1
-rw-r--r--mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test3
-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-get-fk.test10
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test252
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_lz4.test253
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_lzma.test252
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_lzo.test206
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_snappy.test253
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_tables.test103
-rw-r--r--mysql-test/suite/innodb/t/innodb-page_compression_zip.test203
-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.test15
-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-master.opt2
-rw-r--r--mysql-test/suite/innodb/t/innodb_defragment.opt4
-rw-r--r--mysql-test/suite/innodb/t/innodb_defragment.test170
-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.test166
-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_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_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.test4
-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/innodb-fts-fic.result1
-rw-r--r--mysql-test/suite/innodb_fts/r/innodb-fts-stopword.result2
-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_zip/r/innodb-zip.result2
-rw-r--r--mysql-test/suite/innodb_zip/r/innodb_prefix_index_liftedlimit.result2
-rw-r--r--mysql-test/suite/innodb_zip/t/innodb_cmp_drop_table.test4
-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/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/multi_source/info_logs.result12
-rw-r--r--mysql-test/suite/multi_source/info_logs.test13
-rw-r--r--mysql-test/suite/multi_source/multisource.result78
-rw-r--r--mysql-test/suite/multi_source/multisource.test21
-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.test9
-rw-r--r--mysql-test/suite/multi_source/reset_slave.result8
-rw-r--r--mysql-test/suite/multi_source/reset_slave.test8
-rw-r--r--mysql-test/suite/multi_source/simple.result31
-rw-r--r--mysql-test/suite/multi_source/simple.test15
-rw-r--r--mysql-test/suite/multi_source/syntax.result6
-rw-r--r--mysql-test/suite/optimizer_unfixed_bugs/r/bug42991.result6
-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_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_qa_10.result2
-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_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_repair_myisam.result1
-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_debug_myisam-master.opt2
-rw-r--r--mysql-test/suite/parts/t/partition_exch_qa_10.test2
-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/upgrade_check.inc3
-rw-r--r--mysql-test/suite/perfschema/r/column_privilege.result1
-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/nesting.result233
-rw-r--r--mysql-test/suite/perfschema/r/pfs_upgrade_event.result53
-rw-r--r--mysql-test/suite/perfschema/r/pfs_upgrade_func.result53
-rw-r--r--mysql-test/suite/perfschema/r/pfs_upgrade_proc.result53
-rw-r--r--mysql-test/suite/perfschema/r/pfs_upgrade_table.result53
-rw-r--r--mysql-test/suite/perfschema/r/pfs_upgrade_view.result53
-rw-r--r--mysql-test/suite/perfschema/r/privilege.result3
-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/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/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/nesting.test1
-rw-r--r--mysql-test/suite/perfschema/t/privilege.test4
-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_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_v0100.result1
-rw-r--r--mysql-test/suite/plugins/r/cracklib_password_check.result44
-rw-r--r--mysql-test/suite/plugins/r/locales.result143
-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.result152
-rw-r--r--mysql-test/suite/plugins/r/two_password_validations.result21
-rw-r--r--mysql-test/suite/plugins/t/audit_null.test1
-rw-r--r--mysql-test/suite/plugins/t/auth_v0100.test1
-rw-r--r--mysql-test/suite/plugins/t/cracklib_password_check.test37
-rw-r--r--mysql-test/suite/plugins/t/locales.test6
-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.test110
-rw-r--r--mysql-test/suite/plugins/t/two_password_validations.test38
-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.result53
-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/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.result4
-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/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.result3
-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_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_errorlog.result2
-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.result504
-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_mixing_engines.result116
-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.result18
-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_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_maria.result2
-rw-r--r--mysql-test/suite/rpl/r/rpl_stm_until.result10
-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_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_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/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.test18
-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_checksum.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_commit_after_flush.test1
-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.test27
-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_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_loadfile.test1
-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_optimize.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_parallel.test80
-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.test470
-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_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.test3
-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_mysqlbinlog.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.test2
-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.test10
-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_sp.test3
-rw-r--r--mysql-test/suite/rpl/t/rpl_sp_effects.test1
-rw-r--r--mysql-test/suite/rpl/t/rpl_ssl.test1
-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_until.test5
-rw-r--r--mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test3
-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.test76
-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_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_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.def1
-rw-r--r--mysql-test/suite/sys_vars/inc/bin_relay_log_basename_index.inc55
-rw-r--r--mysql-test/suite/sys_vars/inc/explicit_defaults_for_timestamp.inc99
-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/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/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.result175
-rw-r--r--mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_on.result180
-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_log_compressed_pages_basic.result4
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_monitor_disable_basic.result30
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_monitor_enable_basic.result30
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_monitor_reset_all_basic.result30
-rw-r--r--mysql-test/suite/sys_vars/r/innodb_monitor_reset_basic.result30
-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_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_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.result2
-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.rdiff24
-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.rdiff1249
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff580
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff675
-rw-r--r--mysql-test/suite/sys_vars/r/sysvars_innodb.result2387
-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.result4295
-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.result5065
-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.result8
-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/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.result35
-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.result53
-rw-r--r--mysql-test/suite/sys_vars/r/wsrep_max_ws_size_basic.result58
-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.result48
-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.result48
-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.result56
-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.test (renamed from mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test)16
-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/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_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_tc_size_basic.test5
-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/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/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.test14
-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.test10
-rw-r--r--mysql-test/suite/sys_vars/t/version_ssl_library_basic.test2
-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.test35
-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.test45
-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.test44
-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.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.test49
-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_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.test33
-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.inc24
-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_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/suite.pm38
-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_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/t/alter_table.test22
-rw-r--r--mysql-test/t/alter_table_online.test167
-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.test23
-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.test72
-rw-r--r--mysql-test/t/cast.test16
-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.test44
-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_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.test26
-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_utf16.test35
-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_utf8.test58
-rw-r--r--mysql-test/t/ctype_utf8mb4.test59
-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/delete_returning_grant.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/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/engine_error_in_alter-8453.test11
-rw-r--r--mysql-test/t/events_1.test2
-rw-r--r--mysql-test/t/events_2.test4
-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.test7
-rw-r--r--mysql-test/t/func_encrypt.test18
-rw-r--r--mysql-test/t/func_group.test46
-rw-r--r--mysql-test/t/func_hybrid_type.test438
-rw-r--r--mysql-test/t/func_if.test2
-rw-r--r--mysql-test/t/func_in.test13
-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_str.test50
-rw-r--r--mysql-test/t/func_test.test47
-rw-r--r--mysql-test/t/func_time.test6
-rw-r--r--mysql-test/t/func_weight_string.test36
-rw-r--r--mysql-test/t/gis-alter_table_online.test82
-rw-r--r--mysql-test/t/gis-precise.test5
-rw-r--r--mysql-test/t/gis-rtree.test34
-rw-r--r--mysql-test/t/gis.test205
-rw-r--r--mysql-test/t/grant.test13
-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.test30
-rw-r--r--mysql-test/t/group_min_max.test87
-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.test13
-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_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/join_cache.test34
-rw-r--r--mysql-test/t/join_outer.test23
-rw-r--r--mysql-test/t/key.test2
-rw-r--r--mysql-test/t/kill.test32
-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/lowercase_fs_off.test4
-rw-r--r--mysql-test/t/lowercase_fs_on.test2
-rwxr-xr-x[-rw-r--r--]mysql-test/t/lowercase_mixed_tmpdir_innodb-master.sh0
-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/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_upgrade.test26
-rw-r--r--mysql-test/t/mysql_upgrade_view.test1
-rw-r--r--mysql-test/t/mysqlbinlog-innodb.test1
-rw-r--r--mysql-test/t/mysqlbinlog.test16
-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.test7
-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.test64
-rw-r--r--mysql-test/t/not_embedded_server.test2
-rw-r--r--mysql-test/t/null.test653
-rw-r--r--mysql-test/t/old-mode.test10
-rw-r--r--mysql-test/t/openssl_1.test3
-rw-r--r--mysql-test/t/openssl_6975.test2
-rw-r--r--mysql-test/t/order_by.test39
-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.test263
-rw-r--r--mysql-test/t/partition.test14
-rw-r--r--mysql-test/t/partition_bug18198.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/plugin.test2
-rw-r--r--mysql-test/t/plugin_auth.test6
-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/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.test62
-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.test1
-rw-r--r--mysql-test/t/row.test18
-rw-r--r--mysql-test/t/select.test6
-rw-r--r--mysql-test/t/selectivity.test6
-rw-r--r--mysql-test/t/servers.test16
-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/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.test98
-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/stack-crash.test4
-rw-r--r--mysql-test/t/stat_tables_rbr.test3
-rw-r--r--mysql-test/t/statistics.test11
-rw-r--r--mysql-test/t/status.test1
-rw-r--r--mysql-test/t/strict.test16
-rw-r--r--mysql-test/t/subselect.test12
-rw-r--r--mysql-test/t/subselect_cache.test10
-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/symlink.test2
-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.test27
-rw-r--r--mysql-test/t/trigger_notembedded.test2
-rw-r--r--mysql-test/t/trigger_null-8605.test362
-rw-r--r--mysql-test/t/type_date.test166
-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.test65
-rw-r--r--mysql-test/t/type_num.test683
-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_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.test165
-rw-r--r--mysql-test/t/user_limits.test5
-rw-r--r--mysql-test/t/userstat.test (renamed from mysql-test/t/status_user.test)14
-rw-r--r--mysql-test/t/variables-notembedded.test34
-rw-r--r--mysql-test/t/variables.test6
-rw-r--r--mysql-test/t/view.test78
-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/valgrind.supp398
2496 files changed, 155745 insertions, 18676 deletions
diff --git a/mysql-test/CMakeLists.txt b/mysql-test/CMakeLists.txt
index 2948fb88069..1c7cfaf81da 100644
--- a/mysql-test/CMakeLists.txt
+++ b/mysql-test/CMakeLists.txt
@@ -74,7 +74,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()
@@ -92,8 +92,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}
@@ -105,13 +105,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/
@@ -139,3 +139,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/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 5c4b7421b21..e82ddcf92d1 100644
--- a/mysql-test/disabled.def
+++ b/mysql-test/disabled.def
@@ -18,5 +18,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/extra/binlog_tests/database.test b/mysql-test/extra/binlog_tests/database.test
index 82e8b396357..6b3da087f01 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/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_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_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_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_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_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_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_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_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_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_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/include/binlog_start_pos.inc b/mysql-test/include/binlog_start_pos.inc
index 7dac1b376ee..a187e18b3a4 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;
+let $binlog_start_pos=249;
--disable_query_log
-SET @binlog_start_pos=248;
+SET @binlog_start_pos=249;
--enable_query_log
diff --git a/mysql-test/include/check-testcase.test b/mysql-test/include/check-testcase.test
index dcf6bd154ce..083f44ce966 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.
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/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 9e59f54a8b3..1d675a5db6f 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_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_mysqld.cnf b/mysql-test/include/default_mysqld.cnf
index 7b84117639c..17b2fd5b2bc 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
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/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/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/galera_cluster.inc b/mysql-test/include/galera_cluster.inc
new file mode 100644
index 00000000000..bc652225722
--- /dev/null
+++ b/mysql-test/include/galera_cluster.inc
@@ -0,0 +1,10 @@
+# galera_cluster.inc
+# ==================
+#
+# Description
+# -----------
+# Configure galera cluster with 2 nodes.
+#
+
+--let $galera_cluster_size = 2
+--source include/galera_init.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/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/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..e54041da1bc 100644
--- a/mysql-test/include/mtr_check.sql
+++ b/mysql-test/include/mtr_check.sql
@@ -47,7 +47,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 +55,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 345968cd3f0..1ee0658204d 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 occured 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/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/include/restart_mysqld.inc b/mysql-test/include/restart_mysqld.inc
index 71efb141917..dcaf47c55a2 100644
--- a/mysql-test/include/restart_mysqld.inc
+++ b/mysql-test/include/restart_mysqld.inc
@@ -35,7 +35,14 @@ if ($shutdown_timeout == 0)
shutdown_server $server_shutdown_timeout;
# Write file to make mysql-test-run.pl start up the server again
---exec echo "restart" > $_expect_file_name
+if ($restart_parameters)
+{
+ --exec echo "restart: $restart_parameters" > $_expect_file_name
+}
+if (!$restart_parameters)
+{
+ --exec echo "restart" > $_expect_file_name
+}
# Turn on reconnect
--enable_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/search_pattern_in_file.inc b/mysql-test/include/search_pattern_in_file.inc
index 0d09cdcd36e..84237026ed0 100644
--- a/mysql-test/include/search_pattern_in_file.inc
+++ b/mysql-test/include/search_pattern_in_file.inc
@@ -60,12 +60,12 @@
perl;
use strict;
- my $search_file= $ENV{'SEARCH_FILE'} or die "SEARCH_FILE not set";
- my $search_pattern= $ENV{'SEARCH_PATTERN'} or die "SEARCH_PATTERN not set";
- my $search_range= $ENV{'SEARCH_RANGE'};
+ my $search_file= $ENV{'SEARCH_FILE'} or die "SEARCH_FILE not set";
+ my $search_pattern= $ENV{'SEARCH_PATTERN'} or die "SEARCH_PATTERN not set";
+ my $search_range= $ENV{'SEARCH_RANGE'};
my $file_content;
$search_range= 50000 unless $search_range =~ /-?[0-9]+/;
- open(FILE, "$search_file") or die("Unable to open '$search_file': $!\n");
+ open(FILE, '<', $search_file) or die("Unable to open '$search_file': $!\n");
if ($search_range >= 0) {
read(FILE, $file_content, $search_range, 0);
} else {
@@ -75,7 +75,10 @@ perl;
read(FILE, $file_content, -$search_range, 0);
}
close(FILE);
- if ( not $file_content =~ m{$search_pattern} ) {
- die("# ERROR: The file '$search_file' does not contain the expected pattern $search_pattern\n->$file_content<-\n");
+ $search_file =~ s{^.*?([^/\\]+)$}{$1};
+ if ($file_content =~ m{$search_pattern}) {
+ print "FOUND /$search_pattern/ in $search_file\n"
+ } else {
+ print "NOT FOUND /$search_pattern/ in $search_file\n"
}
EOF
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_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..368cfc9e3a7 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)
{
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/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/sync_with_master_gtid.inc b/mysql-test/include/sync_with_master_gtid.inc
index 97ada8eea29..777711b979c 100644
--- a/mysql-test/include/sync_with_master_gtid.inc
+++ b/mysql-test/include/sync_with_master_gtid.inc
@@ -34,6 +34,10 @@ let $_slave_timeout= $slave_timeout;
if (!$_slave_timeout)
{
let $_slave_timeout= 120;
+ if ($VALGRIND_TEST)
+ {
+ let $_slave_timeout= 1200;
+ }
}
--let $_result= `SELECT master_gtid_wait('$master_pos', $_slave_timeout)`
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/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/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/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm
index b8ce038f23e..8b997e8b096 100644
--- a/mysql-test/lib/My/ConfigFactory.pm
+++ b/mysql-test/lib/My/ConfigFactory.pm
@@ -268,65 +268,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
@@ -504,49 +445,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 +488,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 +513,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/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm
index b76b10d42ed..8c2b67c2fda 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)= @_;
@@ -321,7 +319,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 $.")
if defined $1 and defined $suitename and $1 ne $suitename;
$disabled{($1 || $suitename || '') . ".$2"} = $3;
@@ -621,7 +619,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};
@@ -630,8 +628,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;
}
}
@@ -819,29 +818,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 )
@@ -884,9 +860,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) {
@@ -978,10 +955,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/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 accf00dbb5d..e2556d17093 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 9158a70d9cc..01ac06f6fc9 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 == $$ )
@@ -168,6 +171,7 @@ my @DEFAULT_SUITES= qw(
archive-
binlog-
csv-
+ encryption-
federated-
funcs_1-
funcs_2-
@@ -188,6 +192,7 @@ my @DEFAULT_SUITES= qw(
sys_vars-
unit-
vcol-
+ wsrep-
);
my $opt_suites;
@@ -339,16 +344,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 +354,7 @@ my $opt_max_save_datadir= env_or_val(MTR_MAX_SAVE_DATADIR => 20);
my $opt_max_test_fail= env_or_val(MTR_MAX_TEST_FAIL => 10);
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 +407,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();
@@ -603,12 +598,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;
@@ -782,9 +771,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);
@@ -817,7 +803,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;
@@ -837,12 +822,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.
@@ -895,7 +874,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
@@ -1124,9 +1102,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,
@@ -1142,6 +1117,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,
@@ -1832,16 +1808,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)));
}
@@ -1892,7 +1868,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;
}
@@ -1999,51 +1975,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 )
{
@@ -2269,14 +2200,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
@@ -2362,34 +2285,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");
@@ -2879,317 +2774,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) = @_;
@@ -3387,8 +2971,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
@@ -3757,7 +3341,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);
@@ -4124,8 +3708,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) = @_;
@@ -4136,19 +3718,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()) {
@@ -4798,12 +4367,17 @@ 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: Disabling redo log encryption/,
+ qr/InnoDB: Redo log crypto: Can't initialize to key version -1u/,
+ 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:.*)/,
qr/slave SQL thread aborted/,
@@ -4813,7 +4387,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\)/,
@@ -4861,6 +4434,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= [];
@@ -5697,18 +5285,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
#
@@ -5915,6 +5491,12 @@ sub start_mysqltest ($) {
mtr_add_arg($args, "--max-connections=%d", $opt_max_connections);
}
+ if ( $opt_valgrind )
+ {
+ # Longer timeouts when running with valgrind
+ mtr_add_arg($args, "--wait-longer-for-timeouts");
+ }
+
if ( $opt_embedded_server )
{
@@ -6449,9 +6031,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
@@ -6475,6 +6054,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
@@ -6487,6 +6068,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
@@ -6592,7 +6175,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 e572fdb197c..9c0a25f6d61 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
@@ -2021,3 +2030,27 @@ ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS event_id (event_id,market_id);
Warnings:
Note 1061 Multiple primary key defined
DROP TABLE t1;
+#
+# 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;
+#
+# Start of 10.1 tests
+#
+#
+# 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;
diff --git a/mysql-test/r/alter_table_online.result b/mysql-test/r/alter_table_online.result
index db7319cadf1..05d03aeae11 100644
--- a/mysql-test/r/alter_table_online.result
+++ b/mysql-test/r/alter_table_online.result
@@ -62,3 +62,117 @@ create table t3 (a int not null primary key, b int, c varchar(80)) engine=merge
alter online table t3 union=(t1,t2);
ERROR 0A000: LOCK=NONE/SHARED is not supported for this operation. Try LOCK=EXCLUSIVE.
drop table t1,t2,t3;
+#
+# MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB
+#
+CREATE TABLE t1 (a BINARY(10));
+ALTER TABLE t1 MODIFY a BINARY(10), ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a VARBINARY(10));
+ALTER TABLE t1 MODIFY a VARBINARY(10), ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYBLOB);
+ALTER TABLE t1 MODIFY a TINYBLOB, ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMBLOB);
+ALTER TABLE t1 MODIFY a MEDIUMBLOB, ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a BLOB);
+ALTER TABLE t1 MODIFY a BLOB, ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGBLOB);
+ALTER TABLE t1 MODIFY a LONGBLOB, ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a CHAR(10));
+ALTER TABLE t1 MODIFY a CHAR(10), ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10));
+ALTER TABLE t1 MODIFY a VARCHAR(10), ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYTEXT);
+ALTER TABLE t1 MODIFY a TINYTEXT, ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMTEXT);
+ALTER TABLE t1 MODIFY a MEDIUMTEXT, ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT);
+ALTER TABLE t1 MODIFY a TEXT, ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGTEXT);
+ALTER TABLE t1 MODIFY a LONGTEXT, ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a CHAR(10));
+ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_bin, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10));
+ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_bin, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYTEXT);
+ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMTEXT);
+ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT);
+ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGTEXT);
+ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a CHAR(10) COLLATE latin1_bin);
+ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10) COLLATE latin1_bin);
+ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYTEXT COLLATE latin1_bin);
+ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMTEXT COLLATE latin1_bin);
+ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT COLLATE latin1_bin);
+ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGTEXT COLLATE latin1_bin);
+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;
+CREATE TABLE t1 (a CHAR(10) COLLATE latin1_general_ci);
+ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a VARCHAR(10) COLLATE latin1_general_ci);
+ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a TINYTEXT COLLATE latin1_general_ci);
+ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMTEXT COLLATE latin1_general_ci);
+ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a TEXT COLLATE latin1_general_ci);
+ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+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;
+#
+# End of MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB
+#
diff --git a/mysql-test/r/analyze.result b/mysql-test/r/analyze.result
index 9dff94ab08c..5a05d1c5da8 100644
--- a/mysql-test/r/analyze.result
+++ b/mysql-test/r/analyze.result
@@ -34,9 +34,11 @@ create table t1 (a mediumtext, fulltext key key1(a)) charset utf8 collate utf8_g
insert into t1 values ('hello');
analyze table t1;
Table Op Msg_type Msg_text
+test.t1 analyze Warning Engine-independent statistics are not collected for column 'a'
test.t1 analyze status OK
analyze table t1;
Table Op Msg_type Msg_text
+test.t1 analyze Warning Engine-independent statistics are not collected for column 'a'
test.t1 analyze status Table is already up to date
drop table t1;
CREATE TABLE t1 (a int);
diff --git a/mysql-test/r/analyze_format_json.result b/mysql-test/r/analyze_format_json.result
new file mode 100644
index 00000000000..69930bc0215
--- /dev/null
+++ b/mysql-test/r/analyze_format_json.result
@@ -0,0 +1,765 @@
+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,
+ "volatile parameter": "REPLACED",
+ "having_condition": "(TOP > a)",
+ "filesort": {
+ "r_loops": 1,
+ "volatile parameter": "REPLACED",
+ "r_used_priority_queue": false,
+ "r_output_rows": 0,
+ "volatile parameter": "REPLACED",
+ "temporary_table": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 256,
+ "r_rows": 256,
+ "volatile parameter": "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,
+ "volatile parameter": "REPLACED",
+ "filesort": {
+ "r_loops": 1,
+ "volatile parameter": "REPLACED",
+ "r_used_priority_queue": false,
+ "r_output_rows": 256,
+ "volatile parameter": "REPLACED",
+ "temporary_table": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 256,
+ "r_rows": 256,
+ "volatile parameter": "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,
+ "volatile parameter": "REPLACED",
+ "filesort": {
+ "r_loops": 1,
+ "volatile parameter": "REPLACED",
+ "r_used_priority_queue": false,
+ "r_output_rows": 256,
+ "volatile parameter": "REPLACED",
+ "temporary_table": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 256,
+ "r_rows": 256,
+ "volatile parameter": "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,
+ "volatile parameter": "REPLACED",
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 2,
+ "r_rows": 2,
+ "volatile parameter": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ },
+ "block-nl-join": {
+ "table": {
+ "table_name": "<subquery2>",
+ "access_type": "ALL",
+ "possible_keys": ["distinct_key"],
+ "r_loops": 1,
+ "rows": 2,
+ "r_rows": 2,
+ "volatile parameter": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ },
+ "buffer_type": "flat",
+ "buffer_size": "256Kb",
+ "join_type": "BNL",
+ "r_filtered": 100,
+ "materialized": {
+ "unique": 1,
+ "query_block": {
+ "select_id": 2,
+ "r_loops": 1,
+ "volatile parameter": "REPLACED",
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 2,
+ "r_rows": 2,
+ "volatile parameter": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ }
+ }
+ }
+ },
+ "block-nl-join": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 2,
+ "r_rows": 2,
+ "volatile parameter": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ },
+ "buffer_type": "incremental",
+ "buffer_size": "256Kb",
+ "join_type": "BNL",
+ "attached_condition": "(t2.b = `<subquery2>`.a)",
+ "r_filtered": 0
+ }
+ }
+}
+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,
+ "volatile parameter": "REPLACED",
+ "filesort": {
+ "r_loops": 1,
+ "volatile parameter": "REPLACED",
+ "r_used_priority_queue": false,
+ "r_output_rows": 0,
+ "volatile parameter": "REPLACED",
+ "filesort": {
+ "r_loops": 1,
+ "volatile parameter": "REPLACED",
+ "r_used_priority_queue": false,
+ "r_output_rows": 0,
+ "volatile parameter": "REPLACED",
+ "temporary_table": {
+ "temporary_table": {
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 2,
+ "r_rows": 2,
+ "volatile parameter": "REPLACED",
+ "filtered": 100,
+ "r_filtered": 100
+ },
+ "block-nl-join": {
+ "table": {
+ "table_name": "t3",
+ "access_type": "ALL",
+ "r_loops": 1,
+ "rows": 2,
+ "r_rows": 2,
+ "volatile parameter": "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..7d280e66b6c
--- /dev/null
+++ b/mysql-test/r/analyze_stmt_slow_query_log.result
@@ -0,0 +1,15 @@
+drop table if exists t1;
+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/bigint.result b/mysql-test/r/bigint.result
index 505d655b6bb..cc2ab456833 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 3852da5d4b0..b1e928c5e30 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);
@@ -231,3 +231,138 @@ case t1.f1 when '00:00:00' then 1 end
1
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..4c9f257fdf2 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(1) 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,26 @@ 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
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 372e2baa02b..cad46f34c75 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' 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.
-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' 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.
-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
@@ -1925,7 +1143,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;
@@ -1946,7 +1166,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;
@@ -1968,14 +1190,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.
@@ -2120,6 +1342,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 ff8170b7309..ed25fbadf45 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);
@@ -402,29 +400,29 @@ select * from information_schema.metadata_lock_info;
THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Global read lock
# MDL_SHARED_NO_READ_WRITE MDL_EXPLICIT Table metadata lock test t1
-# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Schema metadata lock test
# MDL_SHARED_READ MDL_EXPLICIT Table metadata lock test t2
+# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Schema metadata lock test
create or replace table t1 (i int);
select * from information_schema.metadata_lock_info;
THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Global read lock
# MDL_SHARED_NO_READ_WRITE MDL_EXPLICIT Table metadata lock test t1
-# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Schema metadata lock test
# MDL_SHARED_READ MDL_EXPLICIT Table metadata lock test t2
+# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Schema metadata lock test
create or replace table t1 like t2;
select * from information_schema.metadata_lock_info;
THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Global read lock
# MDL_SHARED_NO_READ_WRITE MDL_EXPLICIT Table metadata lock test t1
-# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Schema metadata lock test
# MDL_SHARED_READ MDL_EXPLICIT Table metadata lock test t2
+# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Schema metadata lock test
create or replace table t1 select 1 as f1;
select * from information_schema.metadata_lock_info;
THREAD_ID LOCK_MODE LOCK_DURATION LOCK_TYPE TABLE_SCHEMA TABLE_NAME
# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Global read lock
# MDL_SHARED_NO_READ_WRITE MDL_EXPLICIT Table metadata lock test t1
-# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Schema metadata lock test
# MDL_SHARED_READ MDL_EXPLICIT Table metadata lock test t2
+# MDL_INTENTION_EXCLUSIVE MDL_EXPLICIT Schema metadata lock test
drop table t1;
unlock tables;
#
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..ada78af7fb9
--- /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' 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.
+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' 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.
+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 aead73b3090..ac79a158943 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
@@ -2900,7 +2900,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;
@@ -2926,7 +2926,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';
@@ -2947,7 +2947,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);
@@ -2968,7 +2968,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);
@@ -2989,7 +2989,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);
@@ -3008,6 +3008,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';
@@ -3016,3 +3041,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 f7952a18f58..08a840f7749 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
@@ -3292,7 +3294,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;
@@ -3332,3 +3334,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 c5d997b0213..b5774548d85 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;
@@ -4946,3 +5102,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 383ea3ca8f2..48475923138 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
@@ -3576,7 +3576,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;
@@ -3620,7 +3620,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;
@@ -3640,7 +3640,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;
@@ -3864,7 +3864,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;
@@ -3884,7 +3884,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;
@@ -4108,7 +4108,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;
@@ -4128,7 +4128,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;
@@ -4352,7 +4352,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;
@@ -4372,7 +4372,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;
@@ -7667,7 +7667,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';
@@ -7690,7 +7690,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);
@@ -7713,7 +7713,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);
@@ -7736,7 +7736,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);
@@ -7755,6 +7755,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
@@ -7763,7 +7788,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';
@@ -7786,7 +7811,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);
@@ -7809,7 +7834,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);
@@ -7832,7 +7857,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);
@@ -7852,6 +7877,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;
@@ -7915,3 +7965,221 @@ _latin1 0x7E _latin1 X'7E' _latin1 B'01111110'
#
# 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_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..2f7cb7156a4 100644
--- a/mysql-test/r/ctype_uca.result
+++ b/mysql-test/r/ctype_uca.result
@@ -6071,8 +6071,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 +6265,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 +6491,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 +6518,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 +6576,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 +6603,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 +6636,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 +6735,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 +6762,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 +6820,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 +6843,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 +6872,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 +6970,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 +6990,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 +7214,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 +7234,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 +7862,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 +7892,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 +8196,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 +8219,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 +8242,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 +8265,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 +8285,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 +8354,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 +8377,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 +8400,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 +8423,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 +8443,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 +8527,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 +11103,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 +13699,32 @@ 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;
+#
+# 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_ucs.result b/mysql-test/r/ctype_ucs.result
index 68435f3f41c..56174311bf3 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
@@ -4483,7 +4509,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;
@@ -4557,7 +4583,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;
@@ -4577,7 +4603,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;
@@ -4801,7 +4827,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;
@@ -4821,7 +4847,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;
@@ -5130,7 +5156,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;
@@ -5273,8 +5299,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;
@@ -5314,7 +5340,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:
@@ -5334,7 +5360,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';
@@ -5357,7 +5383,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);
@@ -5380,7 +5406,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);
@@ -5403,7 +5429,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);
@@ -5422,6 +5448,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
@@ -5430,7 +5481,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';
@@ -5453,7 +5504,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);
@@ -5476,7 +5527,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);
@@ -5499,7 +5550,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);
@@ -5518,6 +5569,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
@@ -5535,3 +5611,43 @@ a aa
#
# 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..b317be42d5c 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;
diff --git a/mysql-test/r/ctype_utf16.result b/mysql-test/r/ctype_utf16.result
index 2d91ce3dd6f..3bd37255b59 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
#
@@ -1596,7 +1600,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;
@@ -1616,7 +1620,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;
@@ -1846,7 +1850,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;
@@ -1866,7 +1870,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;
@@ -2127,3 +2131,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..ac2ed9b2c5b 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
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 0ec89a50c0f..a0a8072265c 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')
@@ -1675,7 +1679,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;
@@ -1695,7 +1699,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;
@@ -1925,7 +1929,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;
@@ -1945,7 +1949,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;
@@ -2206,3 +2210,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..89a9e23bf45 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
diff --git a/mysql-test/r/ctype_utf8.result b/mysql-test/r/ctype_utf8.result
index 532c54dd79e..57a6bfa1a87 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)
@@ -1947,7 +1947,7 @@ 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
@@ -2116,7 +2116,7 @@ select hex(convert(0xFF using utf8));
hex(convert(0xFF using utf8))
NULL
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
@@ -5351,7 +5351,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;
@@ -5365,7 +5365,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);
@@ -5434,7 +5435,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`)
@@ -5461,10 +5462,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:
@@ -5507,6 +5520,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
@@ -5528,6 +5547,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
@@ -5555,11 +5580,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
@@ -5595,11 +5632,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');
@@ -5642,7 +5679,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`)
@@ -5669,10 +5706,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:
@@ -5715,6 +5764,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
@@ -5736,6 +5791,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
@@ -5763,11 +5824,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
@@ -5803,11 +5876,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');
@@ -5850,7 +5923,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`)
@@ -5877,10 +5950,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:
@@ -5923,6 +6008,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
@@ -5942,6 +6031,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
@@ -5967,9 +6060,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
@@ -6003,11 +6104,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');
@@ -6071,11 +6172,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
@@ -6115,7 +6216,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;
@@ -6135,7 +6236,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;
@@ -6359,7 +6460,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;
@@ -6379,7 +6480,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;
@@ -6631,7 +6732,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';
@@ -6654,7 +6755,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);
@@ -6677,7 +6778,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);
@@ -6700,7 +6801,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);
@@ -6719,6 +6820,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
@@ -6727,7 +6853,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';
@@ -6750,7 +6876,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);
@@ -6773,7 +6899,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);
@@ -6796,7 +6922,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);
@@ -6816,13 +6942,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='ä';
@@ -10019,3 +10170,93 @@ DROP TABLE allbytes;
#
# 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;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/ctype_utf8mb4.result b/mysql-test/r/ctype_utf8mb4.result
index d8e97371294..cf053854256 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)
@@ -1972,7 +1972,7 @@ 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
@@ -2141,7 +2141,7 @@ select hex(convert(0xFF using utf8mb4));
hex(convert(0xFF using utf8mb4))
NULL
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;
@@ -2838,7 +2838,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;
@@ -2858,7 +2858,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;
@@ -3082,7 +3082,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;
@@ -3102,7 +3102,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;
@@ -3322,5 +3322,65 @@ DFFFFFDFFFFF9CFFFF9DFFFF9EFFFF
# End of 5.6 tests
#
#
+# Start of 10.0 tests
+#
+#
+# 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;
+#
+# 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'
+#
+# 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..d70e009228e 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)
@@ -1804,7 +1804,7 @@ 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
@@ -1973,7 +1973,7 @@ select hex(convert(0xFF using utf8mb4));
hex(convert(0xFF using utf8mb4))
NULL
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..7d193f397ac 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)
@@ -1932,7 +1932,7 @@ 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
@@ -2101,7 +2101,7 @@ select hex(convert(0xFF using utf8mb4));
hex(convert(0xFF using utf8mb4))
NULL
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..28cf36c7492 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)
@@ -1932,7 +1932,7 @@ 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
@@ -2101,7 +2101,7 @@ select hex(convert(0xFF using utf8mb4));
hex(convert(0xFF using utf8mb4))
NULL
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..1057b9743f4 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
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 9afffe4c3bc..685b534b808 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
@@ -220,3 +222,17 @@ NULL
10
drop table t1, t2;
End of 5.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/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/derived.result b/mysql-test/r/derived.result
index 97ba35ed9cd..1d643333424 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;
@@ -950,3 +949,48 @@ id select_type table type possible_keys key key_len ref rows Extra
2 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
DROP TABLES t1,t2;
set optimizer_switch=@save_derived_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));
+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 fa0a69a487d..639942f0da9 100644
--- a/mysql-test/r/derived_view.result
+++ b/mysql-test/r/derived_view.result
@@ -2262,10 +2262,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,
@@ -2278,10 +2275,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..d6e5a69e217 100644
--- a/mysql-test/r/distinct.result
+++ b/mysql-test/r/distinct.result
@@ -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/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/engine_error_in_alter-8453.result b/mysql-test/r/engine_error_in_alter-8453.result
new file mode 100644
index 00000000000..c5a3375f33c
--- /dev/null
+++ b/mysql-test/r/engine_error_in_alter-8453.result
@@ -0,0 +1,6 @@
+create table t1 (a int, b int);
+set debug_dbug='+d,external_lock_failure';
+alter table t1 add column c int;
+ERROR HY000: Got error 168 'KABOOM!' from MyISAM
+set debug_dbug='';
+drop table t1;
diff --git a/mysql-test/r/events_1.result b/mysql-test/r/events_1.result
index e03ccf51d8b..153137bc4f9 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 3b7f3566cab..c57893ccf6f 100644
--- a/mysql-test/r/events_2.result
+++ b/mysql-test/r/events_2.result
@@ -1,10 +1,11 @@
+set sql_mode="";
drop database if exists events_test;
create database events_test;
use events_test;
-create event e_26 on schedule at '2017-01-01 00:00:00' disable do set @a = 5;
+create event e_26 on schedule at '2027-01-01 00:00:00' disable do set @a = 5;
select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event;
db name body definer convert_tz(execute_at, 'UTC', 'SYSTEM') on_completion
-events_test e_26 set @a = 5 root@localhost 2017-01-01 00:00:00 DROP
+events_test e_26 set @a = 5 root@localhost 2027-01-01 00:00:00 DROP
drop event e_26;
create event e_26 on schedule at NULL disable do set @a = 5;
ERROR HY000: Incorrect AT value: 'NULL'
diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result
index f1ff0faaa47..8920c89fcab 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..a42f5af114c
--- /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) and trigcond(((<cache>(outer_t1.a) = t1.a) or isnull(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 range NULL idx_t1_1 147 NULL 17 Using where; Using index for group-by
+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)
+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": "range",
+ "key": "idx_t1_1",
+ "key_length": "147",
+ "used_key_parts": ["a1", "a2", "b"],
+ "rows": 17,
+ "filtered": 100,
+ "attached_condition": "((t1.b = 'a') and (t1.a2 >= 'b'))",
+ "using_index_for_group_by": 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": "range",
+ "key": "idx_t1_1",
+ "key_length": "163",
+ "used_key_parts": ["a1", "a2", "b", "c"],
+ "rows": 65,
+ "filtered": 100,
+ "attached_condition": "((t1.b = 'a') and (t1.c = 'i121') and (t1.a2 >= 'b'))",
+ "using_index_for_group_by": "scanning"
+ }
+ }
+}
+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": 0,
+ "rows": 1,
+ "r_rows": null,
+ "r_total_time_ms": "REPLACED",
+ "filtered": 100,
+ "r_filtered": null,
+ "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..e9c8193685b 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,7 @@ 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
#
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_group.result b/mysql-test/r/func_group.result
index ac076ec4348..659580059b5 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
@@ -2270,3 +2273,63 @@ t2_id GROUP_CONCAT(IF (t6.b, t6.f, t5.f) ORDER BY 1)
EXECUTE stmt;
t2_id GROUP_CONCAT(IF (t6.b, t6.f, t5.f) ORDER BY 1)
DROP TABLE t1,t2,t3,t4,t5,t6;
+#
+# 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-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;
+#
+# 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..95a8a8235d4
--- /dev/null
+++ b/mysql-test/r/func_hybrid_type.result
@@ -0,0 +1,3400 @@
+#
+# 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 10 19 Y 128 0 63
+def if_______b_a 12 10 19 Y 128 0 63
+def ifnull___a_b 12 10 19 Y 128 0 63
+def ifnull___b_a 12 10 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;
+#
+# 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 fc56660ac62..33a997c8004 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
@@ -812,3 +812,27 @@ EXECUTE s;
1
DROP TABLE t1;
# End of 5.3 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 3631af8a22f..d768672efe4 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;
@@ -695,6 +702,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 bab360d677d..700fda2e182 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;
@@ -1380,6 +1379,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 aa090c9faf6..fcff0484b65 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?://[^/]*');
diff --git a/mysql-test/r/func_set.result b/mysql-test/r/func_set.result
index dfc3faf3fac..96af966d367 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
@@ -233,8 +233,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 8f08d7acd25..f196571218f 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,45 @@ SET NAMES latin2;
EXECUTE stmt;
COLLATION(space(2))
latin2_general_ci
+set global max_allowed_packet=default;
#
# End of 5.6 tests
#
+#
+# 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;
+#
+# 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 85ba5d73f36..ad51010de30 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
#
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-alter_table_online.result b/mysql-test/r/gis-alter_table_online.result
new file mode 100644
index 00000000000..ea7ab3b66bd
--- /dev/null
+++ b/mysql-test/r/gis-alter_table_online.result
@@ -0,0 +1,51 @@
+#
+# Start of 10.1 tests
+#
+#
+# MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB
+#
+CREATE TABLE t1 (a TINYBLOB);
+ALTER TABLE t1 MODIFY a GEOMETRY, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a MEDIUMBLOB);
+ALTER TABLE t1 MODIFY a GEOMETRY, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a BLOB);
+ALTER TABLE t1 MODIFY a GEOMETRY, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a LONGBLOB);
+ALTER TABLE t1 MODIFY a GEOMETRY, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a GEOMETRY);
+ALTER TABLE t1 MODIFY a TINYBLOB, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a GEOMETRY);
+ALTER TABLE t1 MODIFY a MEDIUMBLOB, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a GEOMETRY);
+ALTER TABLE t1 MODIFY a BLOB, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a GEOMETRY);
+ALTER TABLE t1 MODIFY a LONGBLOB, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a GEOMETRY);
+ALTER TABLE t1 MODIFY a POLYGON, ALGORITHM=INPLACE;
+ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY.
+DROP TABLE t1;
+CREATE TABLE t1 (a POLYGON);
+ALTER TABLE t1 MODIFY a GEOMETRY, ALGORITHM=INPLACE;
+DROP TABLE t1;
+CREATE TABLE t1 (a POLYGON);
+ALTER TABLE t1 MODIFY a POLYGON, ALGORITHM=INPLACE;
+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..3824ba6afbb 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,15 @@ 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
DROP TABLE IF EXISTS p1;
CREATE PROCEDURE p1(dist DOUBLE, geom TEXT)
BEGIN
@@ -745,6 +754,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 174088bf944..33080509114 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
@@ -1630,3 +1704,130 @@ SELECT ASTEXT(p) FROM v1;
ASTEXT(p)
POINT(1 1)
DROP VIEW v1;
+End of 5.5 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;
+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 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 3194573e2ef..3020c7deba7 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
@@ -2574,3 +2582,4 @@ Grants for mysqltest_u1@%
GRANT USAGE ON *.* TO 'mysqltest_u1'@'%'
drop database mysqltest_db1;
drop user mysqltest_u1;
+set GLOBAL sql_mode=default;
diff --git a/mysql-test/r/grant2.result b/mysql-test/r/grant2.result
index 3df9a5480d3..bd14f21010b 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 38abbfef261..7f32643b727 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;
diff --git a/mysql-test/r/group_min_max.result b/mysql-test/r/group_min_max.result
index 9421ea9e740..cf867dd1e18 100644
--- a/mysql-test/r/group_min_max.result
+++ b/mysql-test/r/group_min_max.result
@@ -3727,3 +3727,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..e38de6bf5c2 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.11
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_mutex_deadlock_detector.require b/mysql-test/r/have_mutex_deadlock_detector.require
deleted file mode 100644
index 6ed281c757a..00000000000
--- a/mysql-test/r/have_mutex_deadlock_detector.require
+++ /dev/null
@@ -1,2 +0,0 @@
-1
-1
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/help.result b/mysql-test/r/help.result
index 16719cc8193..3a266567175 100644
--- a/mysql-test/r/help.result
+++ b/mysql-test/r/help.result
@@ -148,10 +148,12 @@ help 'impossible_category_1';
source_category_name name is_it_category
impossible_category_1 impossible_function_1 N
impossible_category_1 impossible_function_2 N
+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 c907997573a..9820170aa59 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 6980b5d30ed..fa5280df2b4 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' defined on the table 'test.t1'. This is deprec
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,4 @@ Variable_name Value
Opened_tables 3
drop database mysqltest;
drop database db1;
+set global sql_mode=default;
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 9140f306f77..cae402a9f12 100644
--- a/mysql-test/r/innodb_ext_key.result
+++ b/mysql-test/r/innodb_ext_key.result
@@ -1002,7 +1002,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
diff --git a/mysql-test/r/innodb_icp.result b/mysql-test/r/innodb_icp.result
index fb467494525..bc1c24276ed 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 82f3977e231..59be24dbddc 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/join_cache.result b/mysql-test/r/join_cache.result
index c1dbef08c04..90d305fb384 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;
#
@@ -5867,7 +5918,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 40abc197a36..820d66b9264 100644
--- a/mysql-test/r/join_outer.result
+++ b/mysql-test/r/join_outer.result
@@ -2090,10 +2090,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;
@@ -2245,4 +2245,32 @@ SELECT * FROM t1 INNER JOIN t2 ON c = b LEFT JOIN t3 ON d = a
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;
SET optimizer_switch=@save_optimizer_switch;
diff --git a/mysql-test/r/join_outer_jcl6.result b/mysql-test/r/join_outer_jcl6.result
index 81395612269..4412f8059dd 100644
--- a/mysql-test/r/join_outer_jcl6.result
+++ b/mysql-test/r/join_outer_jcl6.result
@@ -2101,10 +2101,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;
@@ -2256,6 +2256,34 @@ SELECT * FROM t1 INNER JOIN t2 ON c = b LEFT JOIN t3 ON d = a
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;
SET optimizer_switch=@save_optimizer_switch;
set join_cache_level=default;
show variables like 'join_cache_level';
diff --git a/mysql-test/r/key.result b/mysql-test/r/key.result
index a89a79dadbb..9b3dcedf7be 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 2d67d24bedd..8cd3b0a7ac8 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/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 ca8b9e7c439..f7670f3d3db 100644
--- a/mysql-test/r/log_slow.result
+++ b/mysql-test/r/log_slow.result
@@ -56,6 +56,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/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_fs_on.result b/mysql-test/r/lowercase_fs_on.result
index a090f46cfbf..b844b3f77dd 100644
--- a/mysql-test/r/lowercase_fs_on.result
+++ b/mysql-test/r/lowercase_fs_on.result
@@ -1,3 +1,4 @@
#
# Bug#20198490 : LOWER_CASE_TABLE_NAMES=0 ON WINDOWS LEADS TO PROBLEMS
#
+FOUND /\[ERROR\] The server option \'lower_case_table_names\' is configured to use case sensitive table names/ in my_restart.err
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/merge.result b/mysql-test/r/merge.result
index 89aaf48219e..804313af701 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 e824db8928a..bf706b1445d 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 688184f2f83..c680339536b 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 5506e4e419c..093de1339f3 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 49cba60320d..e726a50d89b 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 cb705d285fe..ca19d2eb98b 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);
@@ -519,5 +521,18 @@ 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
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_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.result b/mysql-test/r/mysql_upgrade.result
index 9ba5344fad0..d10e042729f 100644
--- a/mysql-test/r/mysql_upgrade.result
+++ b/mysql-test/r/mysql_upgrade.result
@@ -1,3 +1,4 @@
+set sql_mode="";
Run mysql_upgrade once
Phase 1/6: Checking and upgrading mysql database
Processing databases
@@ -464,4 +465,65 @@ even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@loca
even_longer_user_name_number_3_to_test_the_grantor_and_definer_field_length@localhost
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;
+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/6: 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/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
+Processing databases
+information_schema
+mtr
+mtr.global_suppressions OK
+mtr.test_suppressions OK
+performance_schema
+test
+test.t1 OK
+Phase 6/6: 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 tests
diff --git a/mysql-test/r/mysql_upgrade_view.result b/mysql-test/r/mysql_upgrade_view.result
index 7966941cb1f..f43f42f97fd 100644
--- a/mysql-test/r/mysql_upgrade_view.result
+++ b/mysql-test/r/mysql_upgrade_view.result
@@ -268,6 +268,7 @@ test.kv OK
test.t1 OK
Phase 6/6: 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
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 b29fe0b9ec7..94aaee0c574 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_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 66e23c18355..eb05f056321 100644
--- a/mysql-test/r/mysqlcheck.result
+++ b/mysql-test/r/mysqlcheck.result
@@ -7,19 +7,34 @@ mtr.test_suppressions OK
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
-mysql.event OK
+mysql.event
+Warning : Engine-independent statistics are not collected for column 'body'
+Warning : Engine-independent statistics are not collected for column 'body_utf8'
+status : OK
mysql.func OK
mysql.gtid_slave_pos OK
-mysql.help_category OK
+mysql.help_category
+Warning : Engine-independent statistics are not collected for column 'url'
+status : OK
mysql.help_keyword OK
mysql.help_relation OK
-mysql.help_topic OK
+mysql.help_topic
+Warning : Engine-independent statistics are not collected for column 'description'
+Warning : Engine-independent statistics are not collected for column 'example'
+Warning : Engine-independent statistics are not collected for column 'url'
+status : 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.proc
+Warning : Engine-independent statistics are not collected for column 'param_list'
+Warning : Engine-independent statistics are not collected for column 'returns'
+Warning : Engine-independent statistics are not collected for column 'body'
+Warning : Engine-independent statistics are not collected for column 'comment'
+Warning : Engine-independent statistics are not collected for column 'body_utf8'
+status : OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.roles_mapping OK
@@ -31,7 +46,12 @@ 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
+mysql.user
+Warning : Engine-independent statistics are not collected for column 'ssl_cipher'
+Warning : Engine-independent statistics are not collected for column 'x509_issuer'
+Warning : Engine-independent statistics are not collected for column 'x509_subject'
+Warning : Engine-independent statistics are not collected for column 'authentication_string'
+status : OK
mtr.global_suppressions Table is already up to date
mtr.test_suppressions Table is already up to date
mysql.column_stats OK
@@ -69,19 +89,34 @@ mysql.user OK
mysql.column_stats OK
mysql.columns_priv OK
mysql.db OK
-mysql.event OK
+mysql.event
+Warning : Engine-independent statistics are not collected for column 'body'
+Warning : Engine-independent statistics are not collected for column 'body_utf8'
+status : OK
mysql.func OK
mysql.gtid_slave_pos OK
-mysql.help_category OK
+mysql.help_category
+Warning : Engine-independent statistics are not collected for column 'url'
+status : OK
mysql.help_keyword OK
mysql.help_relation OK
-mysql.help_topic OK
+mysql.help_topic
+Warning : Engine-independent statistics are not collected for column 'description'
+Warning : Engine-independent statistics are not collected for column 'example'
+Warning : Engine-independent statistics are not collected for column 'url'
+status : 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.proc
+Warning : Engine-independent statistics are not collected for column 'param_list'
+Warning : Engine-independent statistics are not collected for column 'returns'
+Warning : Engine-independent statistics are not collected for column 'body'
+Warning : Engine-independent statistics are not collected for column 'comment'
+Warning : Engine-independent statistics are not collected for column 'body_utf8'
+status : OK
mysql.procs_priv OK
mysql.proxies_priv OK
mysql.roles_mapping OK
@@ -93,7 +128,12 @@ 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
+mysql.user
+Warning : Engine-independent statistics are not collected for column 'ssl_cipher'
+Warning : Engine-independent statistics are not collected for column 'x509_issuer'
+Warning : Engine-independent statistics are not collected for column 'x509_subject'
+Warning : Engine-independent statistics are not collected for column 'authentication_string'
+status : OK
mysql.column_stats Table is already up to date
mysql.columns_priv Table is already up to date
mysql.db Table is already up to date
@@ -329,7 +369,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..a09b5603869 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
+@@ -321,7 +321,6 @@ The following options may be given as the first argument:
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
+@@ -517,6 +516,7 @@ The following options may be given as the first argument:
+ 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 @@
+@@ -906,6 +906,9 @@ The following options may be given as the first argument:
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 @@
+@@ -1016,6 +1019,10 @@ The following options may be given as the first argument:
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
+@@ -1034,6 +1041,7 @@ The following options may be given as the first argument:
+ 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.
+@@ -1070,25 +1078,11 @@ The following options may be given as the first argument:
+ COMMIT, ROLLBACK
--thread-cache-size=#
How many threads we should keep in a cache for reuse
- --thread-pool-idle-timeout=#
@@ -72,8 +72,8 @@
+ 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 @@
+ --timed-mutexes Specify whether to time mutexes. Deprecated, has no
+@@ -1097,8 +1091,8 @@ The following options may be given as the first argument:
size, MySQL will automatically convert it to an on-disk
MyISAM or Aria table
-t, --tmpdir=name Path for temporary files. Several paths may be specified,
@@ -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
+@@ -1224,7 +1218,6 @@ key-cache-block-size 1024
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
+@@ -1290,6 +1283,7 @@ myisam-sort-buffer-size 134216704
+ 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
+@@ -1386,6 +1380,8 @@ safe-user-create FALSE
+ 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 @@
+@@ -1409,6 +1405,7 @@ slave-transaction-retries 10
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
+@@ -1421,15 +1418,13 @@ sync-master-info 10000
+ 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 COMMIT
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 65045416a5b..bef03904a72 100644
--- a/mysql-test/r/mysqld--help.result
+++ b/mysql-test/r/mysqld--help.result
@@ -21,9 +21,10 @@ 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
+ --back-log=# The number of outstanding connection requests MariaDB can
have. This comes into play when the main MySQL 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
@@ -39,8 +40,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 +71,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,6 +88,17 @@ 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
@@ -100,6 +108,9 @@ The following options may be given as the first argument:
--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 +125,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,17 +148,19 @@ 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
+ Type of DELAY_KEY_WRITE. One of: OFF, ON, ALL
--delayed-insert-limit=#
After inserting delayed_insert_limit rows, the INSERT
DELAYED handler will check if there are any SELECT
@@ -164,6 +177,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 +197,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.
@@ -207,6 +233,10 @@ The following options may be given as the first argument:
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 +269,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 +280,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 +362,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
@@ -345,10 +376,9 @@ The following options may be given as the first argument:
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 +388,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,7 +452,7 @@ 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
@@ -432,8 +462,12 @@ The following options may be given as the first argument:
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 SELECT query that have 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 +476,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 +496,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 +513,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 +531,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
@@ -528,19 +567,20 @@ The following options may be given as the first argument:
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
--optimizer-use-condition-selectivity=#
Controls selectivity of which conditions the optimizer
takes into account to calculate cardinality of a partial
@@ -696,9 +736,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
@@ -855,13 +895,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 +909,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.
@@ -920,6 +960,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 +977,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 +1000,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
@@ -962,13 +1020,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 +1050,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 +1066,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:
+ COMMIT, ROLLBACK
--thread-cache-size=#
How many threads we should keep in a cache for reuse
--thread-pool-idle-timeout=#
@@ -1031,7 +1103,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 +1120,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 +1137,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 +1149,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-set-server latin1
@@ -1095,15 +1171,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
@@ -1116,6 +1198,7 @@ ft-query-expansion-limit 20
ft-stopword-file (No default value)
gdb FALSE
general-log FALSE
+getopt-prefix-matching TRUE
group-concat-max-len 1024
gtid-domain-id 0
gtid-ignore-duplicates FALSE
@@ -1123,7 +1206,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
@@ -1131,7 +1214,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
@@ -1162,7 +1245,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
@@ -1170,7 +1252,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
@@ -1182,12 +1264,13 @@ 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-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
@@ -1204,8 +1287,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
@@ -1256,7 +1340,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
@@ -1272,14 +1356,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
@@ -1291,19 +1375,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
@@ -1316,7 +1400,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
@@ -1324,26 +1410,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 COMMIT
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.result b/mysql-test/r/mysqldump.result
index 1725291d4c6..6652701090c 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' ;;
@@ -5263,7 +5263,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;
@@ -5313,6 +5314,7 @@ a
DROP TABLE t1;
DROP TABLE t2;
DROP DATABASE db_20772273;
+USE test;
Usage: mysqldump [OPTIONS] database [tables]
OR mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR mysqldump [OPTIONS] --all-databases [OPTIONS]
@@ -5343,3 +5345,176 @@ 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;
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..cd4fa259b3f 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,1143 @@ 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;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/old-mode.result b/mysql-test/r/old-mode.result
index 4f650c3c781..c2ee3324ede 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,15 @@ 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;
diff --git a/mysql-test/r/openssl_1.result b/mysql-test/r/openssl_1.result
index c5dd1500110..1d5c6d179df 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);
@@ -206,4 +208,5 @@ SHOW STATUS LIKE 'Ssl_cipher';
Variable_name Value
Ssl_cipher DHE-RSA-AES256-SHA
DROP USER bug42158@localhost;
+set global sql_mode=default;
End of 5.1 tests
diff --git a/mysql-test/r/openssl_6975,tlsv10.result b/mysql-test/r/openssl_6975,tlsv10.result
index 52d5978749e..6285faa0143 100644
--- a/mysql-test/r/openssl_6975,tlsv10.result
+++ b/mysql-test/r/openssl_6975,tlsv10.result
@@ -1,4 +1,6 @@
+create user ssl_sslv3@localhost;
grant select on test.* to ssl_sslv3@localhost require cipher "RC4-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
diff --git a/mysql-test/r/openssl_6975,tlsv12.result b/mysql-test/r/openssl_6975,tlsv12.result
index 033220427be..31d2658c829 100644
--- a/mysql-test/r/openssl_6975,tlsv12.result
+++ b/mysql-test/r/openssl_6975,tlsv12.result
@@ -1,4 +1,6 @@
+create user ssl_sslv3@localhost;
grant select on test.* to ssl_sslv3@localhost require cipher "RC4-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
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result
index 294142737d9..a015819e480 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
@@ -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
@@ -2949,3 +2951,39 @@ 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;
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 5b0fbbcbe87..01cc9d79aaf 100644
--- a/mysql-test/r/parser.result
+++ b/mysql-test/r/parser.result
@@ -643,3 +643,237 @@ CREATE TRIGGER trigger1 BEFORE INSERT ON t1 FOR EACH ROW
SET default_storage_engine = NEW.INNODB;
ERROR 42S22: Unknown column 'INNODB' in 'NEW'
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 233494238a5..71adc194693 100644
--- a/mysql-test/r/partition.result
+++ b/mysql-test/r/partition.result
@@ -2628,3 +2628,16 @@ alter table t1 drop partition if exists p5;
Warnings:
Note 1507 Error in list of partitions to DROP
DROP TABLE t1;
+#
+# Start of 10.1 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_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_datatype.result b/mysql-test/r/partition_datatype.result
index 804d9dd1c34..fa58df3dec3 100644
--- a/mysql-test/r/partition_datatype.result
+++ b/mysql-test/r/partition_datatype.result
@@ -326,7 +326,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)
@@ -699,7 +699,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;
@@ -782,9 +782,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
@@ -1179,7 +1179,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
@@ -1264,9 +1264,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 f1c3795791a..bfe9dc96bc2 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/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..c23c4f2d8a2 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.11
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.11
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.11
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 8d073f8da1e..e8a7eb133fb 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,13 @@ SET @aux= "SELECT COUNT(*)
prepare my_stmt from @aux;
execute my_stmt;
COUNT(*)
-44
+46
execute my_stmt;
COUNT(*)
-44
+46
execute my_stmt;
COUNT(*)
-44
+46
deallocate prepare my_stmt;
drop procedure if exists p1|
drop table if exists t1|
@@ -2118,9 +2119,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 +2132,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 +2145,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 +2158,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 +2176,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 +2190,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 +2203,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 +2216,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 +2390,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 +2410,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 +2427,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 +2447,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 +2465,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 +2494,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 9981156bc5f..326d37ee560 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/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 50a3a02fe4d..01c642b325b 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 89fac898414..a0e44f91d44 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
@@ -2209,3 +2209,84 @@ 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;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/range_mrr_icp.result b/mysql-test/r/range_mrr_icp.result
index 0350e36eec9..c16d3b4adae 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
@@ -2211,4 +2211,85 @@ 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;
+#
+# 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 c9c569137b2..964c259ebf8 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;
@@ -136,6 +140,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 79bc6d55c55..79ee0c7a9b8 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..98ded32686e 100644
--- a/mysql-test/r/repair_symlink-5543.result
+++ b/mysql-test/r/repair_symlink-5543.result
@@ -2,13 +2,12 @@ create table t1 (a int) engine=myisam data directory='MYSQL_TMP_DIR';
insert t1 values (1);
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 status Operation failed
+test.t1 repair status OK
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 status Operation failed
+test.t2 repair status OK
drop table t2;
+foobar5543
diff --git a/mysql-test/r/row.result b/mysql-test/r/row.result
index f94c958a1be..59a606128f5 100644
--- a/mysql-test/r/row.result
+++ b/mysql-test/r/row.result
@@ -489,3 +489,25 @@ 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;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result
index 7219a9c4462..9dbf6e0c46b 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);
@@ -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
@@ -4482,7 +4482,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
@@ -5301,7 +5301,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 3c62d0676ae..81e52929881 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);
@@ -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
@@ -4493,7 +4493,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
@@ -5312,7 +5312,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 7219a9c4462..9dbf6e0c46b 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);
@@ -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
@@ -4482,7 +4482,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
@@ -5301,7 +5301,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 620bdc6bd50..4238359c201 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;
diff --git a/mysql-test/r/selectivity_innodb.result b/mysql-test/r/selectivity_innodb.result
index 0acbb465ba8..daf28073cf1 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;
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_statement.result b/mysql-test/r/set_statement.result
new file mode 100644
index 00000000000..ad6f3b7bf2e
--- /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;
+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;
+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;
+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;
+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;
+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;
+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;
+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 880c424391e..654b00d68ae 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 5accda75383..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.
#
@@ -71,7 +71,7 @@ connection default;
set password for u1 = PASSWORD('SOMETHINGELSE');
select user, host, password, plugin, authentication_string from mysql.user where user = 'u1';
user host password plugin authentication_string
-u1 % *054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6 mysql_native_password *7AFEFD08B6B720E781FB000CAA418F54FA662626
+u1 % *054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6
#
# Here we should use the password field, as that primes over
# the authentication_string field.
@@ -115,7 +115,7 @@ connection default;
update mysql.user set authentication_string = '' where user='u1';
select user, host, password, plugin, authentication_string from mysql.user where user = 'u1';
user host password plugin authentication_string
-u1 % *054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6 mysql_native_password
+u1 % *054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6
flush privileges;
show grants for u1;
Grants for u1@%
@@ -127,7 +127,7 @@ GRANT SELECT ON `mysql`.* TO 'u1'@'%'
connect con1, localhost, u1,'SOMETHINGELSE',;
select user, host, password, plugin, authentication_string from mysql.user where user = 'u1';
user host password plugin authentication_string
-u1 % *054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6 mysql_native_password
+u1 % *054B7BBD2B9A553DA560520DCD3F76DA2D81B7C6
disconnect con1;
connection default;
#
@@ -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 9332effeb56..cdf97e20238 100644
--- a/mysql-test/r/single_delete_update.result
+++ b/mysql-test/r/single_delete_update.result
@@ -1166,35 +1166,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/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 471576e563f..9453a1da3ca 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;
@@ -7911,3 +7914,80 @@ set global table_open_cache= @tmp_toc;
set global table_definition_cache= @tmp_tdc;
drop procedure p1;
drop table t1,t2,t3,t4,t5,t6;
+# 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;
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/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_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..fdda572f396 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;
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 140db7c5721..55afd159053 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/strict.result b/mysql-test/r/strict.result
index 7cc29ae4ed6..9dcd5975411 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 fa6a0624dcb..ac874f9943c 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
@@ -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
@@ -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
@@ -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)
@@ -6974,7 +6998,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;
#
@@ -7008,7 +7032,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;
#
diff --git a/mysql-test/r/subselect2.result b/mysql-test/r/subselect2.result
index 034cba58c8f..75e8c084026 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/subselect4.result b/mysql-test/r/subselect4.result
index a909230121d..87645d187f2 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
diff --git a/mysql-test/r/subselect_cache.result b/mysql-test/r/subselect_cache.result
index e5a2fe12526..8ca6bf52e0e 100644
--- a/mysql-test/r/subselect_cache.result
+++ b/mysql-test/r/subselect_cache.result
@@ -39,6 +39,231 @@ Handler_read_prev 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 07d00e96549..cfbe5d41418 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
diff --git a/mysql-test/r/subselect_mat.result b/mysql-test/r/subselect_mat.result
index 5f3495aae6f..b5ec6082d68 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);
@@ -2514,3 +2518,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 012d7a80610..6a5bec062c7 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
@@ -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
@@ -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
@@ -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)
@@ -6974,7 +6998,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;
#
@@ -7008,7 +7032,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;
#
diff --git a/mysql-test/r/subselect_no_mat.result b/mysql-test/r/subselect_no_mat.result
index e83697fcb4f..a574319b175 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
@@ -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
@@ -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
@@ -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)
@@ -6968,7 +6992,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;
#
diff --git a/mysql-test/r/subselect_no_opts.result b/mysql-test/r/subselect_no_opts.result
index c620f788cf7..62eecd568f0 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
@@ -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
@@ -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
@@ -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)
@@ -6965,7 +6989,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;
#
@@ -6999,7 +7023,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;
#
diff --git a/mysql-test/r/subselect_no_scache.result b/mysql-test/r/subselect_no_scache.result
index b2b2518bdd3..174c791489c 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
@@ -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
@@ -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
@@ -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)
@@ -6980,7 +7004,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;
#
@@ -7014,7 +7038,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;
#
diff --git a/mysql-test/r/subselect_no_semijoin.result b/mysql-test/r/subselect_no_semijoin.result
index 2bd82dffd36..e0d62ac6d14 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
@@ -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
@@ -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
@@ -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)
@@ -6965,7 +6989,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;
#
@@ -6999,7 +7023,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;
#
diff --git a/mysql-test/r/subselect_sj.result b/mysql-test/r/subselect_sj.result
index 3ca3f0d35fb..be252802c15 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 08a97175487..16e8f88168d 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 ed6bf8bc11b..8e95b963971 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 34d5834bff4..d5e9fc776f8 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);
diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result
index 279af1e44d2..b02c9a0c6f5 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.
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 c633261bcd3..3e0cc480aec 100644
--- a/mysql-test/r/table_elim.result
+++ b/mysql-test/r/table_elim.result
@@ -682,20 +682,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 0a1701be0d7..ee0b3ab6d48 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
@@ -291,3 +291,20 @@ test.t1 repair status OK
test.t2 repair status OK
test.t3 repair status OK
DROP TABLES t1, t2, t3;
+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..86219875bed 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,18 @@ 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;
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..85fc51987d7
--- /dev/null
+++ b/mysql-test/r/trigger_null-8605.result
@@ -0,0 +1,343 @@
+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);
+select * from t1;
+id
+0
+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;
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_blob.result b/mysql-test/r/type_blob.result
index f7816208887..132de86e27b 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 66c9e7e48ef..54f2aa91f2c 100644
--- a/mysql-test/r/type_date.result
+++ b/mysql-test/r/type_date.result
@@ -447,3 +447,363 @@ 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;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/type_datetime.result b/mysql-test/r/type_datetime.result
index 82b64d30d96..155e9535a0a 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,7 +745,7 @@ 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')
DROP TABLE t1;
@@ -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
@@ -836,3 +836,308 @@ DROP TABLE t1,t2;
#
# 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'
+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` = '2001-01-01 00:00:00x')
+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` = '2001-01-01 00:00:00x') 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` = ' 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` = ' 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` = ' garbage ') and (length(`test`.`t1`.`a`) = (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` = TIME'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` = TIME'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 cde8816dee4..85ea43752a5 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
@@ -246,7 +246,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
@@ -305,7 +305,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
@@ -358,6 +358,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..1942d07c9ab 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,92 @@ 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;
+#
+# End of 10.1 tests
+#
diff --git a/mysql-test/r/type_num.result b/mysql-test/r/type_num.result
new file mode 100644
index 00000000000..cbac7b6f445
--- /dev/null
+++ b/mysql-test/r/type_num.result
@@ -0,0 +1,1222 @@
+#
+# 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 DOUBLE 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 DOUBLE 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 DOUBLE 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 DOUBLE 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 DOUBLE 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 DOUBLE 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 DOUBLE 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 DOUBLE 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 DOUBLE 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 DOUBLE 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 DOUBLE 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 DOUBLE 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 DOUBLE 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 1292 Truncated incorrect DOUBLE 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
+#
diff --git a/mysql-test/r/type_ranges.result b/mysql-test/r/type_ranges.result
index 53fc3104666..c998c28ebd9 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_time.result b/mysql-test/r/type_time.result
index 477703edebb..bdcffc8d824 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`) = <cache>(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`) = <cache>(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`) = <cache>(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`) = <cache>(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`) = <cache>(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`) = <cache>(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`) = <cache>(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`) = <cache>(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 1ec2dfc565f..fcdef627ded 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;
@@ -732,3 +732,213 @@ 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'
+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` = '2001-01-01 00:00:00x')
+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` = '2001-01-01 00:00:00x') 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` = ' 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` = ' 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` = ' garbage ') and (length(`test`.`t1`.`a`) = (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` = TIME'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` = TIME'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 965d113124b..e15b029e9c6 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;
#
# Start of 10.0 tests
@@ -549,5 +551,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..842a16e3b4a 100644
--- a/mysql-test/r/type_year.result
+++ b/mysql-test/r/type_year.result
@@ -394,3 +394,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 40f5a77e3d0..dd7c8fcc8ee 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,12 +388,28 @@ 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()
+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
@@ -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;
*
@@ -1202,32 +1266,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;
@@ -1309,7 +1373,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'
@@ -1370,7 +1434,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
@@ -1616,11 +1680,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);
@@ -1638,7 +1709,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);
@@ -1955,3 +2026,104 @@ cccc
bbbb
dddd
drop table t1;
+#
+# 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/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/status_user.result b/mysql-test/r/userstat.result
index 829c8abb634..5ce10d96643 100644
--- a/mysql-test/r/status_user.result
+++ b/mysql-test/r/userstat.result
@@ -25,6 +25,8 @@ 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
@@ -50,6 +52,8 @@ 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
@@ -76,6 +80,9 @@ delete from t1 where a=3;
select * from t1 where a=999;
a b
drop table t1;
+SHOW STATUS LIKE 'Ssl_cipher';
+Variable_name Value
+Ssl_cipher DHE-RSA-AES256-SHA
create table t1 (a int, primary key (a), b int default 0) engine=innodb;
begin;
insert into t1 values(1,1);
@@ -138,8 +145,9 @@ test t1 6 13 13
show index_statistics;
Table_schema Table_name Index_name Rows_read
test t1 PRIMARY 2
-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
+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 2
@@ -155,8 +163,9 @@ 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
+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 2
@@ -178,12 +187,9 @@ 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%";
+show status like "%generic%";
Variable_name Value
-Com_show_client_statistics 0
-Com_show_index_statistics 1
-Com_show_table_statistics 1
-Com_show_user_statistics 0
+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;
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..fef3e4a3e9e 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:
@@ -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 96c35d9dcb3..8ee72c35d0b 100644
--- a/mysql-test/r/view.result
+++ b/mysql-test/r/view.result
@@ -1350,8 +1350,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 +2240,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 +2905,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 +2929,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;
@@ -4426,36 +4433,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;
#
@@ -5430,6 +5459,7 @@ DROP FUNCTION f1;
DROP VIEW v1;
DROP TABLE t1, t2;
create view v1 as select 1;
+FOUND /mariadb-version/ in v1.frm
drop view v1;
#
# MDEV-7260: Crash in get_best_combination when executing multi-table
@@ -5785,3 +5815,74 @@ ERROR 42S22: Unknown column 'SOME_GARBAGE.b.a' in 'field list'
# -- 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;
+#
+# 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 24b95f0e204..41dbc744228 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/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/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..e511521d7ab
--- /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
+
diff --git a/mysql-test/std_data/keys2.txt b/mysql-test/std_data/keys2.txt
new file mode 100644
index 00000000000..aa1600b894d
--- /dev/null
+++ b/mysql-test/std_data/keys2.txt
@@ -0,0 +1,6 @@
+1;593E580927F47AB530D3B1237CDEF6D6
+2;352E42F1B9DB5CB915C3262FE745520A
+3;CFE065600F5EB57481075C65180C3F8A
+4;205379930183490D3BECA139BDF4DB5B
+5;E2D944D5D837A1DCB22FF7FD397892EE
+6;BAFE99B0BB87F2CD33A6AF26A11F6BD1
diff --git a/mysql-test/std_data/keys3.txt b/mysql-test/std_data/keys3.txt
new file mode 100644
index 00000000000..4f6c618d2ad
--- /dev/null
+++ b/mysql-test/std_data/keys3.txt
@@ -0,0 +1,7 @@
+1;593E580927F47AB530D3B1237CDEF6D6
+2;E4B00A45BF775B4E07D634EC5CA5912B
+3;6E35ACB162B29D1FB9E178021DAF16ED
+4;971A664A88EE0022D408E40BFAB17E79
+5;C4FF86FD89879380DA97EAC0BA3057B7
+6;BAFE99B0BB87F2CD33A6AF26A11F6BD1
+
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/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..ea07af7376c 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,8 @@ 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;
}
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 97f48407db2..6ee50fd3b85 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_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_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_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_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 20a4b52f1a7..181f254cd5d 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/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_index.test b/mysql-test/suite/binlog/t/binlog_index.test
index a264549ce17..26f3595db2b 100644
--- a/mysql-test/suite/binlog/t/binlog_index.test
+++ b/mysql-test/suite/binlog/t/binlog_index.test
@@ -37,6 +37,7 @@ 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 ***
@@ -57,6 +58,7 @@ remove_file $MYSQLD_DATADIR/master-bin.000001;
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
@@ -77,6 +79,7 @@ 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/;
@@ -91,6 +94,7 @@ 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';
@@ -111,6 +115,7 @@ 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';
@@ -134,6 +139,7 @@ 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';
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_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_row_annotate.test b/mysql-test/suite/binlog/t/binlog_row_annotate.test
index a0f72c9222c..e831b29df00 100644
--- a/mysql-test/suite/binlog/t/binlog_row_annotate.test
+++ b/mysql-test/suite/binlog/t/binlog_row_annotate.test
@@ -24,6 +24,8 @@
--disable_query_log
+set sql_mode="";
+
# Fix timestamp to avoid varying results
SET timestamp=1000000000;
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 2de84a58875..c9e92e21002 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/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..8c0d47983fd
--- /dev/null
+++ b/mysql-test/suite/encryption/disabled.def
@@ -0,0 +1,17 @@
+##############################################################################
+#
+# 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
+innodb_scrub_compressed : MDEV-8139
+innodb_scrub_background : MDEV-8139
+innodb_encryption-page-compression : Fails with lost connection at line 156
+
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/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..8793e6ba363
--- /dev/null
+++ b/mysql-test/suite/encryption/r/debug_key_management.result
@@ -0,0 +1,21 @@
+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 space,name,current_key_version from information_schema.innodb_tablespaces_encryption order by space;
+space name current_key_version
+0 NULL 1
+1 mysql/innodb_table_stats 1
+2 mysql/innodb_index_stats 1
+set global debug_key_management_version=10;
+select space,name,current_key_version from information_schema.innodb_tablespaces_encryption order by space;
+space name current_key_version
+0 NULL 10
+1 mysql/innodb_table_stats 10
+2 mysql/innodb_index_stats 10
+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..f95e70bf19e
--- /dev/null
+++ b/mysql-test/suite/encryption/r/encrypt_and_grep.result
@@ -0,0 +1,42 @@
+SET GLOBAL innodb_file_per_table = ON;
+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;
+insert t1 values (repeat('foobar', 42));
+insert t2 values (repeat('temp', 42));
+insert t3 values (repeat('dummy', 42));
+# 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 /temp/ in t2.ibd
+# t3 no on expecting FOUND
+FOUND /dummy/ in t3.ibd
+# ibdata1 expecting NOT FOUND
+NOT FOUND /foobar/ in ibdata1
+# Now turn off encryption and wait for threads to decrypt everything
+SET GLOBAL innodb_encryption_threads = 4;
+SET GLOBAL innodb_encrypt_tables = off;
+# Wait max 10 min for key encryption threads to decrypt all spaces
+# t1 yes on expecting NOT FOUND
+NOT FOUND /foobar/ in t1.ibd
+# t2 ... on expecting FOUND
+FOUND /temp/ in t2.ibd
+# t3 no on expecting FOUND
+FOUND /dummy/ in t3.ibd
+# ibdata1 expecting NOT FOUND
+NOT FOUND /foobar/ in ibdata1
+# Now turn on encryption and wait for threads to encrypt all spaces
+SET GLOBAL innodb_encryption_threads = 4;
+SET GLOBAL innodb_encrypt_tables = on;
+# 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 /temp/ in t2.ibd
+# t3 no on expecting FOUND
+FOUND /dummy/ in t3.ibd
+# ibdata1 expecting NOT FOUND
+NOT FOUND /foobar/ in ibdata1
+# TODO: add shutdown + grep tests
+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..de5f7da60a8
--- /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: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options")
+alter table t2 encrypted=yes;
+alter table t3 encrypted=default;
+alter table t4 encrypted=no;
+ERROR HY000: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options")
+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_encfile.result b/mysql-test/suite/encryption/r/filekeys_encfile.result
new file mode 100644
index 00000000000..add6f312fda
--- /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: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options")
+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..add6f312fda
--- /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: Can't create table `test`.`#sql-temporary` (errno: 140 "Wrong create options")
+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..eb8119bc4f5
--- /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 11
+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_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..955d150eb04
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innochecksum.result
@@ -0,0 +1,23 @@
+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;
+# 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
+# Write file to make mysql-test-run.pl start up the server again
+# Cleanup
+DROP TABLE t1, t2, t3, t4, t5;
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..cf9791887cc
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change.result
@@ -0,0 +1,136 @@
+call mtr.add_suppression("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed.*");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted");
+call mtr.add_suppression("InnoDB: However key management plugin or used key_id .* is not found or used encryption algorithm or method does not match.");
+call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file.");
+call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem.");
+call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*");
+call mtr.add_suppression("mysqld: File .*");
+call mtr.add_suppression("InnoDB: Tablespace id .* is encrypted but encryption service or used key_id .* is not available. Can't continue opening tablespace.");
+
+# 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 1812 Tablespace is missing for table 'test/t1'
+Warning 192 Table test/t1 is encrypted but encryption service or used key_id 2 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;
+# Start server with keys.txt
+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 is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+Warning 192 Table test/t2 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 1812 Tablespace is missing for table 'test/t2'
+Warning 192 Table test/t2 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 1812 Tablespace is missing for table 'test/t2'
+Warning 192 Table test/t2 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 1812 Tablespace is missing for table 'test/t2'
+Warning 192 Table test/t2 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 1812 Tablespace is missing for table 'test/t2'
+Warning 192 Table test/t2 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 1812 Tablespace is missing for table 'test/t2'
+Warning 192 Table test/t2 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 1812 Tablespace is missing for table 'test/t2'
+Warning 192 Table test/t2 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 Tablespace is missing for table 'test/t2'
+test.t2 optimize Warning Table test/t2 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 c 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 1812 Tablespace is missing for table 'test/t2'
+Warning 192 Table test/t2 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 Tablespace is missing for table 'test/t2'
+test.t2 analyze Warning Table test/t2 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 1812 Tablespace is missing for table 'test/t2'
+Warning 192 Table test/t2 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;
+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
+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
+
+# Restart server with keys.txt
+DROP TABLE t2;
+SHOW WARNINGS;
+Level Code Message
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..ea760e7a213
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change2.result
@@ -0,0 +1,26 @@
+call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted");
+call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match.");
+call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file.");
+call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem.");
+call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*");
+call mtr.add_suppression("Couldn't load plugins from 'file_key_management*");
+CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB 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 is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+Warning 192 Table test/t1 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 discard 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 warnings;
+Level Code Message
+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 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
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..68d8552a0a3
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change3.result
@@ -0,0 +1,44 @@
+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 (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
+UNLOCK TABLES;
+# Tablespaces should be still encrypted
+# t1 yes on expecting NOT FOUND
+NOT FOUND /foobar/ in t1.ibd
+ALTER TABLE t1 DISCARD TABLESPACE;
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+# List after t1 DISCARD
+t1.frm
+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..531ba4063a4
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change4.result
@@ -0,0 +1,20 @@
+call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted");
+call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match.");
+call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file.");
+call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem.");
+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 ENCRYPTION_KEY_ID=4;
+INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+CHECK TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 check Warning Table test/t1 in tablespace 4 is encrypted but encryption service or used key_id is not available. Can't continue reading table.
+test.t1 check Warning Table test/t1 is encrypted but encryption service or used key_id is not available. Can't continue checking table.
+test.t1 check error Corrupt
+SHOW WARNINGS;
+Level Code Message
+DROP TABLE t1;
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-change5.result b/mysql-test/suite/encryption/r/innodb-bad-key-change5.result
new file mode 100644
index 00000000000..11130a7a20b
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-change5.result
@@ -0,0 +1,28 @@
+call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted");
+call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match.");
+call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file.");
+call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem.");
+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 ENCRYPTION_KEY_ID=4;
+INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize Warning Table test/t1 is encrypted but encryption service or used key_id is not available. Can't continue checking table.
+test.t1 optimize Warning InnoDB: Cannot defragment table test/t1: returned error code 192
+
+test.t1 optimize note Table does not support optimize, doing recreate + analyze instead
+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 status Operation failed
+Warnings:
+Warning 192 Table test/t1 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
+SHOW WARNINGS;
+Level Code Message
+Warning 192 Table test/t1 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;
diff --git a/mysql-test/suite/encryption/r/innodb-bad-key-shutdown.result b/mysql-test/suite/encryption/r/innodb-bad-key-shutdown.result
new file mode 100644
index 00000000000..630fba146bf
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-bad-key-shutdown.result
@@ -0,0 +1,20 @@
+call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted");
+call mtr.add_suppression("InnoDB: However key management plugin or used key_id .* is not found or used encryption algorithm or method does not match.");
+call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file.");
+call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem.");
+call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*");
+call mtr.add_suppression("Couldn't load plugins from 'file_key_management*");
+#
+# Restart the server with key 4 in the key file
+#
+CREATE TABLE t1 (i INT, KEY(i)) ENGINE=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
+INSERT INTO t1 VALUES (1);
+#
+# Restart the server with a different value for key 4 in the key file
+#
+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 t1;
+i
+1
+DROP TABLE t1;
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..195b82f7488
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-discard-import.result
@@ -0,0 +1,144 @@
+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, 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
+UNLOCK TABLES;
+# tables should be 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
+ALTER TABLE t1 DISCARD TABLESPACE;
+ALTER TABLE t2 DISCARD TABLESPACE;
+ALTER TABLE t3 DISCARD TABLESPACE;
+ALTER TABLE t4 DISCARD TABLESPACE;
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+SET GLOBAL innodb_compression_algorithm = 1;
+# List after t1 DISCARD
+t1.frm
+t2.frm
+t3.frm
+t4.frm
+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` (
+ `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;
+Warnings:
+Warning 1814 Tablespace has been discarded for table 't2'
+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;
+Warnings:
+Warning 1814 Tablespace has been discarded for table 't3'
+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;
+Warnings:
+Warning 1814 Tablespace has been discarded for table 't4'
+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
+flush data to disk
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+SET GLOBAL innodb_compression_algorithm = 1;
+# 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..5869c5d7000
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-encryption-alter.result
@@ -0,0 +1,53 @@
+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: Can't create table `test`.`#sql-temporary` (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`.`#sql-temporary` (errno: 140 "Wrong create options")
+Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
+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..63ff1dcda71
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-encryption-disable.result
@@ -0,0 +1,32 @@
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted");
+call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match.");
+call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file.");
+call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem.");
+call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*");
+call mtr.add_suppression("Couldn't load plugins from 'file_key_management*");
+call mtr.add_suppression("InnoDB: Tablespace id.* is encrypted but encryption service or used key_id .* is not available. Can't continue opening tablespace.");
+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-log-encrypt.result b/mysql-test/suite/encryption/r/innodb-log-encrypt.result
new file mode 100644
index 00000000000..3e281efd08a
--- /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('secredsecredsecred',10));
+set current_num = current_num + 1;
+end while;
+end//
+commit;
+set autocommit=0;
+call innodb_insert_proc(2000);
+commit;
+set autocommit=1;
+update t1 set c1 = c1 +1;
+select count(*) from t1;
+count(*)
+2000
+# ibdata1 yes on expecting NOT FOUND
+NOT FOUND /secredsecred/ in ibdata1
+# t1 yes on expecting NOT FOUND
+NOT FOUND /secredsecred/ in t1.ibd
+# log0 yes on expecting NOT FOUND
+NOT FOUND /secredsecred/ in ib_logfile0
+# log1 yes on expecting NOT FOUND
+NOT FOUND /secredsecred/ in ib_logfile1
+# Restart mysqld --innodb_encrypt_log=0
+insert into t1 values(5000, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
+insert into t1 values(5001, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
+insert into t1 values(5002, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
+insert into t1 values(5003, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
+insert into t1 values(5004, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
+# ibdata1 yes on expecting NOT FOUND
+NOT FOUND /secredsecred/ in ibdata1
+# t1 yes on expecting NOT FOUND
+NOT FOUND /secredsecred/ in t1.ibd
+# log0 yes on expecting NOT FOUND
+NOT FOUND /secredsecred/ in ib_logfile0
+# log1 yes on expecting NOT FOUND
+NOT FOUND /secredsecred/ in ib_logfile1
+# ibdata1 yes on expecting NOT FOUND
+NOT FOUND /notsecred/ in ibdata1
+# t1 yes on expecting NOT FOUND
+NOT FOUND /notsecred/ in t1.ibd
+# log0 no on expecting FOUND/NOTFOUND depending where insert goes
+FOUND /notsecred/ in ib_logfile0
+# log1 no on expecting FOUND/NOTFOUND depending where insert goes
+NOT FOUND /notsecred/ in ib_logfile1
+drop procedure innodb_insert_proc;
+drop table t1;
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..f7ffc77fd66
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-page_encryption_compression.result
@@ -0,0 +1,184 @@
+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;
+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_normal set c1 = c1 + 1;
+update innodb_compact set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+select count(*) from innodb_normal;
+count(*)
+5000
+select count(*) from innodb_compact where c1 < 1500000;
+count(*)
+5000
+select count(*) from innodb_dynamic where c1 < 1500000;
+count(*)
+5000
+select count(*) from innodb_compact t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+5000
+select count(*) from innodb_dynamic t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+5000
+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_compressed';
+variable_value >= 0
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decompressed';
+variable_value >= 0
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+set global innodb_compression_algorithm = 1;
+update innodb_normal set c1 = c1 + 1;
+update innodb_compact set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+select count(*) from innodb_normal;
+count(*)
+5000
+select count(*) from innodb_compact where c1 < 1500000;
+count(*)
+5000
+select count(*) from innodb_dynamic where c1 < 1500000;
+count(*)
+5000
+select count(*) from innodb_compact t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+5000
+select count(*) from innodb_dynamic t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+5000
+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_compressed';
+variable_value >= 0
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decompressed';
+variable_value >= 0
+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
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+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
+update innodb_normal set c1 = c1 + 1;
+update innodb_compact set c1 = c1 + 1;
+update innodb_dynamic set c1 = c1 + 1;
+select count(*) from innodb_normal;
+count(*)
+5000
+select count(*) from innodb_compact where c1 < 1500000;
+count(*)
+5000
+select count(*) from innodb_dynamic where c1 < 1500000;
+count(*)
+5000
+select count(*) from innodb_compact t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+5000
+select count(*) from innodb_dynamic t1, innodb_normal t2 where
+t1.c1 = t2.c1 and t1.b = t2.b;
+count(*)
+5000
+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_compressed';
+variable_value = 0
+SELECT variable_value = 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decompressed';
+variable_value = 0
+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..92130da19e9
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb-page_encryption_log_encryption.result
@@ -0,0 +1,249 @@
+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*");
+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;
+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;
+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
+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 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
+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
+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;
+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_encryption-page-compression.result b/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result
new file mode 100644
index 00000000000..e3238990aaa
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_encryption-page-compression.result
@@ -0,0 +1,264 @@
+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;
+set autocommit=0;
+call innodb_insert_proc(5000);
+commit;
+set autocommit=1;
+select count(*) from innodb_normal;
+count(*)
+5000
+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(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+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
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+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
+SET GLOBAL innodb_encryption_threads = 4;
+SET GLOBAL innodb_encrypt_tables = off;
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+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..283c78e33d3
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_encryption.result
@@ -0,0 +1,57 @@
+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
+DESCRIBE INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
+Field Type Null Key Default Extra
+SPACE int(11) unsigned NO 0
+NAME varchar(655) YES NULL
+ENCRYPTION_SCHEME int(11) unsigned NO 0
+KEYSERVER_REQUESTS int(11) unsigned NO 0
+MIN_KEY_VERSION int(11) unsigned NO 0
+CURRENT_KEY_VERSION int(11) unsigned NO 0
+KEY_ROTATION_PAGE_NUMBER bigint(21) unsigned YES NULL
+KEY_ROTATION_MAX_PAGE_NUMBER bigint(21) unsigned YES NULL
+# Wait max 5 min for key encryption threads to encrypt one space
+# Success!
+# Wait max 10 min for key encryption threads to encrypt all space
+# 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 decrypt all space
+# 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
+# Success!
+# Startup innodb_encryption_threads
+SET GLOBAL innodb_encryption_threads=@start_global_value;
+# Wait 1 min to check that it start encrypting again
+# Success!
+#
+# Check that restart with encryption turned off works
+# even if spaces are encrypted
+#
+# First wait max 10 min for key encryption threads to encrypt all spaces
+# 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 COUNT(*) > 0 as should_be_1
+FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION
+WHERE MIN_KEY_VERSION <> 0;
+should_be_1
+1
+# Restart mysqld again...with default options
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..f8c59b7bcc3
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_encryption_discard_import.result
@@ -0,0 +1,149 @@
+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
+FLUSH TABLE t1, t2, t3 FOR EXPORT;
+# List before copying files
+t1.cfg
+t1.frm
+t1.ibd
+t2.cfg
+t2.frm
+t2.ibd
+t3.cfg
+t3.frm
+t3.ibd
+UNLOCK TABLES;
+# Restarting server
+# Done restarting server
+# List before t1 DISCARD
+t1.frm
+t1.ibd
+t2.frm
+t2.ibd
+t3.frm
+t3.ibd
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+ALTER TABLE t1 DISCARD TABLESPACE;
+ALTER TABLE t2 DISCARD TABLESPACE;
+ALTER TABLE t3 DISCARD TABLESPACE;
+# List after t1 DISCARD
+t1.frm
+t2.frm
+t3.frm
+# Restarting server
+# Done restarting server
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+# Tablespaces should be still 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
+ALTER TABLE t1 IMPORT TABLESPACE;
+Warnings:
+Warning 1814 Tablespace has been discarded for table 't1'
+SELECT COUNT(1) FROM t1;
+COUNT(1)
+10000
+ALTER TABLE t2 IMPORT TABLESPACE;
+Warnings:
+Warning 1814 Tablespace has been discarded for table 't2'
+SELECT COUNT(1) FROM t2;
+COUNT(1)
+10000
+ALTER TABLE t3 IMPORT TABLESPACE;
+Warnings:
+Warning 1814 Tablespace has been discarded for table 't3'
+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
+# Wait max 10 min for key encryption threads to encrypt all spaces
+# Tablespaces should be encrypted after alter table
+# 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
+# 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
+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_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_onlinealter_encryption.result b/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result
new file mode 100644
index 00000000000..a3a3ab3fed6
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_onlinealter_encryption.result
@@ -0,0 +1,176 @@
+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',42));
+insert into t2 values (current_num,repeat('temp', 42));
+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(15000);
+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 /temp/ 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
+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 /temp/ 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
+# Restarting server
+# Done restarting server
+select count(1) from t1;
+count(1)
+15000
+select count(1) from t2;
+count(1)
+15000
+select count(1) from t3;
+count(1)
+15000
+select count(1) from t4;
+count(1)
+15000
+select count(1) from t5;
+count(1)
+15000
+select count(1) from t6;
+count(1)
+15000
+select count(1) from t7;
+count(1)
+15000
+# 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
+# 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..95f0aed3226
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_scrub.result
@@ -0,0 +1,224 @@
+create table snapshot_status engine = myisam
+select * from information_schema.global_status
+where variable_name like 'innodb_scrub%';
+#
+# Test delete of records
+#
+create table t1 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=compact;
+# Populate table with rows
+delete from t1;
+# restart mysqld so that all pages are flushed
+# read all rows from table
+select * from t1;
+# compact: delete from: grep -c bicycle t1.ibd
+0
+# compact: delete from: grep -c bicycle ibdata1
+0
+# compact: delete from: grep -c repairman t1.ibd
+0
+# compact: delete from: grep -c repairman ibdata1
+0
+drop table t1;
+#
+# Test delete+rollback+delete
+#
+create table t1 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=compact;
+# Populate table with rows
+begin;
+delete from t1;
+rollback;
+delete from t1;
+# restart mysqld so that all pages are flushed
+# read all rows from table
+select * from t1;
+# compact: delete rollback: grep -c bicycle t1.ibd
+0
+# compact: delete rollback: grep -c bicycle ibdata1
+0
+# compact: delete rollback: grep -c repairman t1.ibd
+0
+# compact: delete rollback: grep -c repairman ibdata1
+0
+drop table t1;
+#
+# Test insert+rollback
+#
+create table t1 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=compact;
+# Populate table with rows
+begin;
+rollback;
+# restart mysqld so that all pages are flushed
+# read all rows from table
+select * from t1;
+# compact: insert rollback: grep -c bicycle t1.ibd
+0
+# compact: insert rollback: grep -c bicycle ibdata1
+0
+# compact: insert rollback: grep -c repairman t1.ibd
+0
+# compact: insert rollback: grep -c repairman ibdata1
+0
+drop table t1;
+#
+# Test delete of records
+#
+create table t1 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=redundant;
+# Populate table with rows
+delete from t1;
+# restart mysqld so that all pages are flushed
+# read all rows from table
+select * from t1;
+# redundant: delete from: grep -c bicycle t1.ibd
+0
+# redundant: delete from: grep -c bicycle ibdata1
+0
+# redundant: delete from: grep -c repairman t1.ibd
+0
+# redundant: delete from: grep -c repairman ibdata1
+0
+drop table t1;
+#
+# Test delete+rollback+delete
+#
+create table t1 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=redundant;
+# Populate table with rows
+begin;
+delete from t1;
+rollback;
+delete from t1;
+# restart mysqld so that all pages are flushed
+# read all rows from table
+select * from t1;
+# redundant: delete rollback: grep -c bicycle t1.ibd
+0
+# redundant: delete rollback: grep -c bicycle ibdata1
+0
+# redundant: delete rollback: grep -c repairman t1.ibd
+0
+# redundant: delete rollback: grep -c repairman ibdata1
+0
+drop table t1;
+#
+# Test insert+rollback
+#
+create table t1 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=redundant;
+# Populate table with rows
+begin;
+rollback;
+# restart mysqld so that all pages are flushed
+# read all rows from table
+select * from t1;
+# redundant: insert rollback: grep -c bicycle t1.ibd
+0
+# redundant: insert rollback: grep -c bicycle ibdata1
+0
+# redundant: insert rollback: grep -c repairman t1.ibd
+0
+# redundant: insert rollback: grep -c repairman ibdata1
+0
+drop table t1;
+#
+# Test delete of records
+#
+create table t1 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=dynamic;
+# Populate table with rows
+delete from t1;
+# restart mysqld so that all pages are flushed
+# read all rows from table
+select * from t1;
+# dynamic: delete from: grep -c bicycle t1.ibd
+0
+# dynamic: delete from: grep -c bicycle ibdata1
+0
+# dynamic: delete from: grep -c repairman t1.ibd
+0
+# dynamic: delete from: grep -c repairman ibdata1
+0
+drop table t1;
+#
+# Test delete+rollback+delete
+#
+create table t1 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=dynamic;
+# Populate table with rows
+begin;
+delete from t1;
+rollback;
+delete from t1;
+# restart mysqld so that all pages are flushed
+# read all rows from table
+select * from t1;
+# dynamic: delete rollback: grep -c bicycle t1.ibd
+0
+# dynamic: delete rollback: grep -c bicycle ibdata1
+0
+# dynamic: delete rollback: grep -c repairman t1.ibd
+0
+# dynamic: delete rollback: grep -c repairman ibdata1
+0
+drop table t1;
+#
+# Test insert+rollback
+#
+create table t1 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=dynamic;
+# Populate table with rows
+begin;
+rollback;
+# restart mysqld so that all pages are flushed
+# read all rows from table
+select * from t1;
+# dynamic: insert rollback: grep -c bicycle t1.ibd
+0
+# dynamic: insert rollback: grep -c bicycle ibdata1
+0
+# dynamic: insert rollback: grep -c repairman t1.ibd
+0
+# dynamic: insert rollback: grep -c repairman ibdata1
+0
+drop table t1;
+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..1ff6c0bda98
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_scrub_background.result
@@ -0,0 +1,81 @@
+#
+# 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 snapshot_status engine = myisam
+select * from information_schema.global_status
+where variable_name like 'innodb_scrub%';
+truncate table snapshot_status;
+insert into snapshot_status
+select * from information_schema.global_status
+where variable_name like 'innodb_scrub%';
+#
+# Test delete of records
+#
+create table t1 (
+a int auto_increment primary key,
+b varchar(256),
+c text, index(b)) engine = innodb row_format=dynamic;
+# Populate table with rows
+delete from t1;
+#
+# Test delete+rollback+delete
+#
+create table t2 (
+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 t2;
+rollback;
+delete from t2;
+#
+# Test insert+rollback
+#
+create table t3 (
+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
+# Success!
+# stop scrubbing threads
+SET GLOBAL innodb_encryption_threads=0;
+# restart mysqld so that all pages are flushed
+# read all rows from table
+select * from t1;
+# dynamic: delete: grep -c bicycle t1.ibd
+0
+# dynamic: delete: grep -c repairman t1.ibd
+0
+# dynamic: delete rollback: grep -c bicycle t2.ibd
+0
+# dynamic: delete rollback: grep -c repairman t2.ibd
+0
+# dynamic: insert rollback: grep -c bicycle t3.ibd
+0
+# dynamic: insert rollback: grep -c repairman t3.ibd
+0
+drop table t1, t2, t3;
+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
+drop table snapshot_status;
diff --git a/mysql-test/suite/encryption/r/innodb_scrub_compressed.result b/mysql-test/suite/encryption/r/innodb_scrub_compressed.result
new file mode 100644
index 00000000000..0b5e9f11a05
--- /dev/null
+++ b/mysql-test/suite/encryption/r/innodb_scrub_compressed.result
@@ -0,0 +1,71 @@
+# make sure spaces are checked quickly
+SET GLOBAL innodb_background_scrub_data_check_interval=1;
+#
+# Test delete of records
+#
+create table t1 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=compressed;
+# Populate table with rows
+delete from t1;
+#
+# Test delete+rollback+delete
+#
+create table t2 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=compressed;
+# Populate table with rows
+begin;
+delete from t2;
+rollback;
+delete from t2;
+#
+# Test insert+rollback
+#
+create table t3 (
+a int auto_increment primary key,
+b varchar(256),
+c text) engine = innodb row_format=compressed;
+# Populate table with rows
+begin;
+rollback;
+# start scrubbing threads
+SET GLOBAL innodb_encryption_threads=5;
+# Wait max 10 min for scrubbing of this table
+# Success!
+# stop scrubbing threads
+SET GLOBAL innodb_encryption_threads=0;
+# Now there should be background scrubs
+# restart mysqld so that all pages are flushed (encryption off)
+# so that grep will find stuff
+# read all rows from table
+select * from t1;
+select * from t2;
+select * from t3;
+# grep -c bicycle t1.ibd
+0
+# grep -c bicycle ibdata1
+0
+# grep -c repairman t1.ibd
+0
+# grep -c repairman ibdata1
+0
+# grep -c boondoggle t2.ibd
+0
+# grep -c boondoggle ibdata1
+0
+# grep -c waste t2.ibd
+0
+# grep -c waste ibdata1
+0
+# grep -c keso t3.ibd
+0
+# grep -c keso ibdata1
+0
+# grep -c kent t3.ibd
+0
+# grep -c kent ibdata1
+0
+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..b4dc8c41916
--- /dev/null
+++ b/mysql-test/suite/encryption/t/debug_key_management.test
@@ -0,0 +1,24 @@
+-- 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 $wait_condition= select count(*) = 3 from information_schema.innodb_tablespaces_encryption where current_key_version=1;
+--source include/wait_condition.inc
+
+select space,name,current_key_version from information_schema.innodb_tablespaces_encryption order by space;
+set global debug_key_management_version=10;
+
+let $wait_condition= select count(*) = 3 from information_schema.innodb_tablespaces_encryption where current_key_version=10;
+--source include/wait_condition.inc
+
+select space,name,current_key_version from information_schema.innodb_tablespaces_encryption order by space;
+# 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..bcff011eb82
--- /dev/null
+++ b/mysql-test/suite/encryption/t/encrypt_and_grep.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/encrypt_and_grep.test b/mysql-test/suite/encryption/t/encrypt_and_grep.test
new file mode 100644
index 00000000000..2a5fcbcebf8
--- /dev/null
+++ b/mysql-test/suite/encryption/t/encrypt_and_grep.test
@@ -0,0 +1,108 @@
+-- source include/have_innodb.inc
+-- source include/have_example_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
+--let SEARCH_PATTERN=foobar
+
+SET GLOBAL innodb_file_per_table = ON;
+
+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;
+
+insert t1 values (repeat('foobar', 42));
+insert t2 values (repeat('temp', 42));
+insert t3 values (repeat('dummy', 42));
+
+--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
+
+--sleep 5
+
+--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=dummy
+--echo # t3 no on expecting FOUND
+-- let SEARCH_FILE=$t3_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=foobar
+--echo # ibdata1 expecting NOT FOUND
+-- let SEARCH_FILE=$ib1_IBD
+-- source include/search_pattern_in_file.inc
+
+--echo # Now turn off encryption and wait for threads to decrypt everything
+SET GLOBAL innodb_encryption_threads = 4;
+SET GLOBAL innodb_encrypt_tables = off;
+
+--echo # Wait max 10 min for key encryption threads to decrypt 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
+--sleep 5
+
+--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 FOUND
+-- let SEARCH_FILE=$t2_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=dummy
+--echo # t3 no on expecting FOUND
+-- let SEARCH_FILE=$t3_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=foobar
+--echo # ibdata1 expecting NOT FOUND
+-- let SEARCH_FILE=$ib1_IBD
+-- source include/search_pattern_in_file.inc
+
+--echo # Now turn on encryption and wait for threads to encrypt all spaces
+SET GLOBAL innodb_encryption_threads = 4;
+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
+--sleep 5
+
+--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=dummy
+--echo # t3 no on expecting FOUND
+-- let SEARCH_FILE=$t3_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=foobar
+--echo # ibdata1 expecting NOT FOUND
+-- let SEARCH_FILE=$ib1_IBD
+-- source include/search_pattern_in_file.inc
+
+--echo # TODO: add shutdown + grep tests
+
+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..3e09dd91839
--- /dev/null
+++ b/mysql-test/suite/encryption/t/encryption_force.test
@@ -0,0 +1,41 @@
+-- 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;
+
+--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
+--error ER_CANT_CREATE_TABLE
+alter table t1 encrypted=no;
+alter table t2 encrypted=yes;
+alter table t3 encrypted=default;
+--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
+--error ER_CANT_CREATE_TABLE
+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_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_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..146a570412c
--- /dev/null
+++ b/mysql-test/suite/encryption/t/filekeys_goodtest.inc
@@ -0,0 +1,20 @@
+-- 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;
+--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
+--error ER_CANT_CREATE_TABLE
+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_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..a176cad6c0e
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innochecksum.test
@@ -0,0 +1,101 @@
+#
+# MDEV-8773: InnoDB innochecksum does not work with encrypted or page compressed tables
+#
+
+# Don't test under embedded
+-- source include/not_embedded.inc
+# Require InnoDB
+-- source include/have_innodb.inc
+-- source include/have_file_key_management_plugin.inc
+
+if (!$INNOCHECKSUM) {
+ --echo Need innochecksum binary
+ --die Need innochecksum binary
+}
+
+--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;
+
+--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;
+
+--disable_query_log
+--let $i = 1000
+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;
+--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;
+
+--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
+
+--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
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--echo # Cleanup
+DROP TABLE t1, t2, t3, t4, t5;
+
+# 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-bad-key-change.test b/mysql-test/suite/encryption/t/innodb-bad-key-change.test
new file mode 100644
index 00000000000..9180fb12085
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change.test
@@ -0,0 +1,122 @@
+-- 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
+-- source include/not_windows.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("Plugin 'file_key_management' init function returned error");
+call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed.*");
+call mtr.add_suppression("Plugin 'file_key_management' registration.*failed");
+call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted");
+call mtr.add_suppression("InnoDB: However key management plugin or used key_id .* is not found or used encryption algorithm or method does not match.");
+call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file.");
+call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem.");
+call mtr.add_suppression("InnoDB: .ibd file is missing for table test/.*");
+call mtr.add_suppression("mysqld: File .*");
+call mtr.add_suppression("InnoDB: Tablespace id .* is encrypted but encryption service or used key_id .* is not available. Can't continue opening tablespace.");
+--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_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=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;
+SHOW WARNINGS;
+
+-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keysbad3.txt
+-- source include/restart_mysqld.inc
+DROP TABLE t1;
+
+#
+# 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 keys.txt
+-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt
+-- source include/restart_mysqld.inc
+
+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]*//
+SHOW WARNINGS;
+--error ER_GET_ERRMSG
+SELECT * FROM t2 where id = 1;
+SHOW WARNINGS;
+--error ER_GET_ERRMSG
+SELECT * FROM t2 where b = 1;
+SHOW WARNINGS;
+--error ER_GET_ERRMSG
+INSERT INTO t2 VALUES ('tmp',3,3);
+SHOW WARNINGS;
+--error ER_GET_ERRMSG
+DELETE FROM t2 where b = 3;
+SHOW WARNINGS;
+--error ER_GET_ERRMSG
+DELETE FROM t2 where id = 3;
+SHOW WARNINGS;
+--error ER_GET_ERRMSG
+UPDATE t2 set b = b +1;
+SHOW WARNINGS;
+OPTIMIZE TABLE t2;
+SHOW WARNINGS;
+--error ER_GET_ERRMSG
+ALTER TABLE t2 ADD COLUMN c INT;
+SHOW WARNINGS;
+ANALYZE TABLE t2;
+SHOW WARNINGS;
+--error ER_GET_ERRMSG
+TRUNCATE TABLE t2;
+SHOW WARNINGS;
+--error ER_GET_ERRMSG
+DROP TABLE t2;
+SHOW WARNINGS;
+
+--echo
+--echo # Restart server with keys.txt
+-- let $restart_parameters=--file-key-management-filename=$MYSQL_TEST_DIR/std_data/keys.txt
+-- source include/restart_mysqld.inc
+
+DROP TABLE t2;
+SHOW WARNINGS;
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..7c61c34ec59
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change2.test
@@ -0,0 +1,59 @@
+--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-8750: Server crashes in page_cur_is_after_last on altering table using a wrong encryption key
+#
+call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted");
+call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match.");
+call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file.");
+call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem.");
+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*");
+
+--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
+
+CREATE TABLE t1 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTION_KEY_ID=4;
+INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
+
+--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
+
+--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
+
+--error ER_GET_ERRMSG
+select * from t1;
+show warnings;
+--error ER_GET_ERRMSG
+alter table t1 discard tablespace;
+show warnings;
+--error ER_GET_ERRMSG
+alter table t1 engine=InnoDB;
+show warnings;
+
+--remove_file $MYSQLTEST_VARDIR/keys1.txt
+--remove_file $MYSQLTEST_VARDIR/keys2.txt
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..20d63b10649
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change3.test
@@ -0,0 +1,114 @@
+--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: 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`;
+--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
+
+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;
+SHOW CREATE TABLE t1;
+INSERT INTO t1 VALUES (1,'foobar'),(2,'barfoo');
+FLUSH TABLE t1 FOR EXPORT;
+--echo # List before copying files
+--list_files $MYSQLD_DATADIR/test
+--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_TMPDIR/t1.cfg
+--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_TMPDIR/t1.ibd
+UNLOCK TABLES;
+
+--sleep 5
+--echo # Tablespaces should be still encrypted
+--let SEARCH_PATTERN=foobar
+--echo # t1 yes on expecting NOT FOUND
+-- let SEARCH_FILE=$t1_IBD
+-- source include/search_pattern_in_file.inc
+
+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
+
+--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
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+--echo # List after t1 DISCARD
+--list_files $MYSQLD_DATADIR/test
+--copy_file $MYSQLD_TMPDIR/t1.cfg $MYSQLD_DATADIR/test/t1.cfg
+--copy_file $MYSQLD_TMPDIR/t1.ibd $MYSQLD_DATADIR/test/t1.ibd
+
+--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_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
+
+--remove_file $MYSQLTEST_VARDIR/keys1.txt
+--remove_file $MYSQLTEST_VARDIR/keys2.txt
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..96f9563fb3b
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change4.test
@@ -0,0 +1,89 @@
+--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-8768: Server crash at file btr0btr.ic line 122 when checking encrypted table using incorrect keys
+#
+call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted");
+call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match.");
+call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file.");
+call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem.");
+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*");
+
+--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
+
+--let $MYSQLD_TMPDIR = `SELECT @@tmpdir`
+--let $MYSQLD_DATADIR = `SELECT @@datadir`
+
+--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 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTION_KEY_ID=4;
+INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
+
+--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
+
+--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
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+CHECK TABLE t1;
+SHOW WARNINGS;
+
+--remove_file $MYSQLTEST_VARDIR/keys1.txt
+--remove_file $MYSQLTEST_VARDIR/keys2.txt
+
+--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
+
+DROP TABLE t1;
+
+--remove_file $MYSQLTEST_VARDIR/keys1.txt
+
+# 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-bad-key-change5.opt b/mysql-test/suite/encryption/t/innodb-bad-key-change5.opt
new file mode 100644
index 00000000000..6426bac41a0
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change5.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-change5.test b/mysql-test/suite/encryption/t/innodb-bad-key-change5.test
new file mode 100644
index 00000000000..c6c0c963818
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-change5.test
@@ -0,0 +1,88 @@
+--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-8769: Server crash at file btr0btr.ic line 122 when defragmenting encrypted table using incorrect keys
+#
+call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted");
+call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match.");
+call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file.");
+call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem.");
+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*");
+
+--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-defragment=1 --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
+
+--let $MYSQLD_TMPDIR = `SELECT @@tmpdir`
+--let $MYSQLD_DATADIR = `SELECT @@datadir`
+
+--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 (pk INT PRIMARY KEY, f VARCHAR(8)) ENGINE=InnoDB ENCRYPTION_KEY_ID=4;
+INSERT INTO t1 VALUES (1,'foo'),(2,'bar');
+
+--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
+
+--exec echo "restart:--innodb-encrypt-tables --innodb-defragment=1 --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
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+OPTIMIZE TABLE t1;
+SHOW WARNINGS;
+
+--remove_file $MYSQLTEST_VARDIR/keys1.txt
+--remove_file $MYSQLTEST_VARDIR/keys2.txt
+
+--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-defragment=1 --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;
+--remove_file $MYSQLTEST_VARDIR/keys1.txt
+
+# 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-bad-key-shutdown.test b/mysql-test/suite/encryption/t/innodb-bad-key-shutdown.test
new file mode 100644
index 00000000000..d27402edaa8
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-bad-key-shutdown.test
@@ -0,0 +1,68 @@
+#
+# MDEV-8727: Server/InnoDB hangs on shutdown after trying to read an encrypted table with a wrong key
+#
+
+call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted");
+call mtr.add_suppression("InnoDB: However key management plugin or used key_id .* is not found or used encryption algorithm or method does not match.");
+call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file.");
+call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem.");
+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*");
+
+--echo #
+--echo # Restart the server with key 4 in the key file
+--echo #
+
+--source include/have_innodb.inc
+--source include/not_embedded.inc
+
+--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;18420B5CBA31CCDFFE9716E91EB61374D05914F3ADE23E03
+EOF
+
+--exec echo "restart:--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=InnoDB ENCRYPTED=YES ENCRYPTION_KEY_ID=4;
+INSERT INTO t1 VALUES (1);
+
+--echo #
+--echo # Restart the server with a different value for key 4 in the key file
+--echo #
+
+--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;22222222222222222222222222222222
+EOF
+
+--exec echo "restart:--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
+
+--error 1296
+SELECT * FROM t1;
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--exec echo "restart:--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
+
+SELECT * FROM t1;
+DROP TABLE t1;
+
+--remove_file $MYSQLTEST_VARDIR/keys2.txt
+--remove_file $MYSQLTEST_VARDIR/keys1.txt
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..6d9f6c5dbb3
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-discard-import.test
@@ -0,0 +1,167 @@
+-- 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: 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
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+SET GLOBAL innodb_compression_algorithm = 1;
+
+--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;
+
+FLUSH TABLE t1,t2,t3,t4 FOR EXPORT;
+--echo # List before copying files
+--list_files $MYSQLD_DATADIR/test
+--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_TMPDIR/t1.cfg
+--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_TMPDIR/t1.ibd
+--copy_file $MYSQLD_DATADIR/test/t2.cfg $MYSQLD_TMPDIR/t2.cfg
+--copy_file $MYSQLD_DATADIR/test/t2.ibd $MYSQLD_TMPDIR/t2.ibd
+--copy_file $MYSQLD_DATADIR/test/t3.cfg $MYSQLD_TMPDIR/t3.cfg
+--copy_file $MYSQLD_DATADIR/test/t3.ibd $MYSQLD_TMPDIR/t3.ibd
+--copy_file $MYSQLD_DATADIR/test/t4.cfg $MYSQLD_TMPDIR/t4.cfg
+--copy_file $MYSQLD_DATADIR/test/t4.ibd $MYSQLD_TMPDIR/t4.ibd
+UNLOCK TABLES;
+
+--echo # tables should be 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
+
+ALTER TABLE t1 DISCARD TABLESPACE;
+ALTER TABLE t2 DISCARD TABLESPACE;
+ALTER TABLE t3 DISCARD TABLESPACE;
+ALTER TABLE t4 DISCARD TABLESPACE;
+
+--source include/restart_mysqld.inc
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+SET GLOBAL innodb_compression_algorithm = 1;
+
+--echo # List after t1 DISCARD
+--list_files $MYSQLD_DATADIR/test
+--copy_file $MYSQLD_TMPDIR/t1.cfg $MYSQLD_DATADIR/test/t1.cfg
+--copy_file $MYSQLD_TMPDIR/t1.ibd $MYSQLD_DATADIR/test/t1.ibd
+--copy_file $MYSQLD_TMPDIR/t2.cfg $MYSQLD_DATADIR/test/t2.cfg
+--copy_file $MYSQLD_TMPDIR/t2.ibd $MYSQLD_DATADIR/test/t2.ibd
+--copy_file $MYSQLD_TMPDIR/t3.cfg $MYSQLD_DATADIR/test/t3.cfg
+--copy_file $MYSQLD_TMPDIR/t3.ibd $MYSQLD_DATADIR/test/t3.ibd
+--copy_file $MYSQLD_TMPDIR/t4.cfg $MYSQLD_DATADIR/test/t4.cfg
+--copy_file $MYSQLD_TMPDIR/t4.ibd $MYSQLD_DATADIR/test/t4.ibd
+
+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 flush data to disk
+--source include/restart_mysqld.inc
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+SET GLOBAL innodb_compression_algorithm = 1;
+
+--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_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
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..316ece1c16b
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-encryption-alter.test
@@ -0,0 +1,98 @@
+-- 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;
+--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
+--error 1005
+ALTER TABLE t1 ENCRYPTION_KEY_ID=99;
+--replace_regex /#sql-[0-9a-f_]*/#sql-temporary/
+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..42d8008d1aa
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-encryption-disable.test
@@ -0,0 +1,92 @@
+-- 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
+
+--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;
+
+#
+# MDEV-9559: Server without encryption configs crashes if selecting from an implicitly encrypted table
+#
+call mtr.add_suppression("InnoDB: Block in space_id .* in file test/.* encrypted");
+call mtr.add_suppression("InnoDB: However key management plugin or used key_id 1 is not found or used encryption algorithm or method does not match.");
+call mtr.add_suppression("InnoDB: Marking tablespace as missing. You may drop this table or install correct key management plugin and key file.");
+call mtr.add_suppression(".*InnoDB: Cannot open table test/.* from the internal data dictionary of InnoDB though the .frm file for the table exists. See .* for how you can resolve the problem.");
+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*");
+call mtr.add_suppression("InnoDB: Tablespace id.* is encrypted but encryption service or used key_id .* is not available. Can't continue opening tablespace.");
+
+--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 --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 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;
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--exec echo "restart:--innodb-encrypt-tables=OFF" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+
+--error 1296
+select * from t1;
+--error 1296
+select * from t5;
+
+--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--shutdown_server
+--source include/wait_until_disconnected.inc
+
+--exec echo "restart:--innodb-encrypt-tables --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;
+drop table t5;
+
+--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
+
+--remove_file $MYSQLTEST_VARDIR/keys1.txt
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..b2abfadccc2
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-log-encrypt.test
@@ -0,0 +1,112 @@
+-- source include/have_innodb.inc
+-- source include/not_embedded.inc
+-- source filekeys_plugin.inc
+
+#
+# MDEV-9011: Redo log encryption does not work
+#
+
+--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_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(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('secredsecredsecred',10));
+ set current_num = current_num + 1;
+ end while;
+end//
+delimiter ;//
+commit;
+
+set autocommit=0;
+call innodb_insert_proc(2000);
+commit;
+set autocommit=1;
+
+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=secredsecred
+
+--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/restart_mysqld.inc
+
+insert into t1 values(5000, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
+insert into t1 values(5001, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
+insert into t1 values(5002, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
+insert into t1 values(5003, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
+insert into t1 values(5004, substring(MD5(RAND()), -64), REPEAT('notsecred',10));
+
+--let SEARCH_PATTERN=secredsecred
+--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=notsecred
+--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;
+
+# 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-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..1d59c39d637
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-page_encryption_compression.test
@@ -0,0 +1,131 @@
+-- source include/have_innodb.inc
+-- source include/not_embedded.inc
+-- source include/have_file_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 $encryption = `SELECT @@innodb_encrypt_tables`;
+--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 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;
+
+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_normal set c1 = c1 + 1;
+update innodb_compact set c1 = c1 + 1;
+update innodb_dynamic 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_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 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_compressed';
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decompressed';
+
+--source include/restart_mysqld.inc
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+# zlib
+set global innodb_compression_algorithm = 1;
+
+update innodb_normal set c1 = c1 + 1;
+update innodb_compact set c1 = c1 + 1;
+update innodb_dynamic 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_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 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_compressed';
+SELECT variable_value >= 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decompressed';
+
+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;
+
+--source include/restart_mysqld.inc
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+show create table innodb_normal;
+show create table innodb_compact;
+show create table innodb_dynamic;
+
+update innodb_normal set c1 = c1 + 1;
+update innodb_compact set c1 = c1 + 1;
+update innodb_dynamic 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_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 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_compressed';
+SELECT variable_value = 0 FROM information_schema.global_status WHERE variable_name = 'innodb_num_pages_decompressed';
+
+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;
+EVAL SET GLOBAL innodb_encrypt_tables = $encryption;
+--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..b6fe0d10b65
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb-page_encryption_log_encryption.test
@@ -0,0 +1,168 @@
+-- source include/have_innodb.inc
+-- source include/not_embedded.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
+
+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*");
+
+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;
+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;
+
+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;
+
+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;
+
+# 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;
+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';
+
+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;
+
+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;
+
+#
+# MDEV-8143: InnoDB: Database page corruption on disk or a failed file read
+#
+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;
+
+# 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-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..c2c7bd96d3e
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_encryption-page-compression.test
@@ -0,0 +1,169 @@
+-- source include/have_innodb.inc
+-- source include/have_example_key_management_plugin.inc
+
+# embedded does not support restart
+-- 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`;
+let $innodb_encrypt_tables_orig = `SELECT @@innodb_encrypt_tables`;
+let $innodb_encryption_threads_orig = `SELECT @@innodb_encryption_threads`;
+--enable_query_log
+
+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;
+
+# 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;
+
+set autocommit=0;
+call innodb_insert_proc(5000);
+commit;
+set autocommit=1;
+select count(*) from innodb_normal;
+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;
+
+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
+
+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;
+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';
+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;
+
+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;
+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';
+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..50aca2a7260
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_encryption.test
@@ -0,0 +1,176 @@
+#
+#
+#
+-- source include/have_innodb.inc
+-- source include/have_example_key_management_plugin.inc
+
+# embedded does not support restart
+-- source include/not_embedded.inc
+
+SET @start_global_value = @@global.innodb_encryption_threads;
+
+SHOW VARIABLES LIKE 'innodb_encrypt%';
+
+DESCRIBE INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION;
+
+--echo # Wait max 5 min for key encryption threads to encrypt one space
+let $cnt=300;
+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!
+
+--echo # Wait max 10 min for key encryption threads to encrypt all space
+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!
+
+--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 space
+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!
+
+--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 $cnt=15;
+while ($cnt)
+{
+ let $success=`SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0`;
+ if ($success)
+ {
+ real_sleep 1;
+ dec $cnt;
+ }
+ if (!$success)
+ {
+ SELECT * FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0;
+ -- die Failure, tablespace getting encrypted even if innodb_encryption_threads=0
+ }
+}
+--echo # Success!
+
+--echo # Startup innodb_encryption_threads
+SET GLOBAL innodb_encryption_threads=@start_global_value;
+
+--echo # Wait 1 min to check that it start encrypting again
+let $cnt=60;
+while ($cnt)
+{
+ let $success=`SELECT COUNT(*) > 0 FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION WHERE MIN_KEY_VERSION <> 0 OR KEY_ROTATION_PAGE_NUMBER IS NOT NULL`;
+ 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!
+
+--echo #
+--echo # Check that restart with encryption turned off works
+--echo # even if spaces are encrypted
+--echo #
+--echo # First 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!
+--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 COUNT(*) > 0 as should_be_1
+FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION
+WHERE MIN_KEY_VERSION <> 0;
+
+--echo # Restart mysqld again...with default options
+-- let $restart_parameters=
+-- source include/restart_mysqld.inc
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..def3665eeff
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_encryption_discard_import.test
@@ -0,0 +1,233 @@
+-- source include/have_innodb.inc
+-- source include/have_example_key_management_plugin.inc
+-- source include/not_valgrind.inc
+-- source include/not_embedded.inc
+-- source include/not_windows.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
+
+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;
+
+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
+
+FLUSH TABLE t1, t2, t3 FOR EXPORT;
+
+--echo # List before copying files
+--list_files $MYSQLD_DATADIR/test
+--disable_result_log
+--error 0,1,2
+--remove_file $MYSQLD_TMPDIR/t1.cfg
+--error 0,1,2
+--remove_file $MYSQLD_TMPDIR/t1.ibd
+--error 0,1,2
+--remove_file $MYSQLD_TMPDIR/t2.cfg
+--error 0,1,2
+--remove_file $MYSQLD_TMPDIR/t2.ibd
+--error 0,1,2
+--remove_file $MYSQLD_TMPDIR/t3.cfg
+--error 0,1,2
+--remove_file $MYSQLD_TMPDIR/t3.ibd
+--enable_result_log
+--copy_file $MYSQLD_DATADIR/test/t1.cfg $MYSQLD_TMPDIR/t1$id.cfg
+--copy_file $MYSQLD_DATADIR/test/t1.ibd $MYSQLD_TMPDIR/t1$id.ibd
+--copy_file $MYSQLD_DATADIR/test/t2.cfg $MYSQLD_TMPDIR/t2$id.cfg
+--copy_file $MYSQLD_DATADIR/test/t2.ibd $MYSQLD_TMPDIR/t2$id.ibd
+--copy_file $MYSQLD_DATADIR/test/t3.cfg $MYSQLD_TMPDIR/t3$id.cfg
+--copy_file $MYSQLD_DATADIR/test/t3.ibd $MYSQLD_TMPDIR/t3$id.ibd
+UNLOCK TABLES;
+
+--echo # Restarting server
+-- source include/restart_mysqld.inc
+--echo # Done restarting server
+--echo # List before t1 DISCARD
+--list_files $MYSQLD_DATADIR/test
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+ALTER TABLE t1 DISCARD TABLESPACE;
+ALTER TABLE t2 DISCARD TABLESPACE;
+ALTER TABLE t3 DISCARD TABLESPACE;
+
+--echo # List after t1 DISCARD
+--list_files $MYSQLD_DATADIR/test
+--error 0,1,2
+--remove_file $MYSQLD_DATADIR/test/t1.cfg
+--error 0,1,2
+--remove_file $MYSQLD_DATADIR/test/t1.ibd
+--error 0,1,2
+--remove_file $MYSQLD_DATADIR/test/t2.cfg
+--error 0,1,2
+--remove_file $MYSQLD_DATADIR/test/t2.ibd
+--error 0,1,2
+--remove_file $MYSQLD_DATADIR/test/t3.cfg
+--error 0,1,2
+--remove_file $MYSQLD_DATADIR/test/t3.ibd
+--enable_result_log
+--echo # Restarting server
+-- source include/restart_mysqld.inc
+--echo # Done restarting server
+
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+
+--copy_file $MYSQLD_TMPDIR/t1$id.cfg $MYSQLD_DATADIR/test/t1.cfg
+--copy_file $MYSQLD_TMPDIR/t1$id.ibd $MYSQLD_DATADIR/test/t1.ibd
+--copy_file $MYSQLD_TMPDIR/t2$id.cfg $MYSQLD_DATADIR/test/t2.cfg
+--copy_file $MYSQLD_TMPDIR/t2$id.ibd $MYSQLD_DATADIR/test/t2.ibd
+--copy_file $MYSQLD_TMPDIR/t3$id.cfg $MYSQLD_DATADIR/test/t3.cfg
+--copy_file $MYSQLD_TMPDIR/t3$id.ibd $MYSQLD_DATADIR/test/t3.ibd
+
+--sleep 5
+--echo # Tablespaces should be still 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
+--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 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 # 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 encrypted after alter table
+--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 # 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
+
+
+DROP PROCEDURE innodb_insert_proc;
+DROP TABLE t1, t2, t3;
+
+# 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_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_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_onlinealter_encryption.opt b/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.opt
new file mode 100644
index 00000000000..bcff011eb82
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.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_onlinealter_encryption.test b/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test
new file mode 100644
index 00000000000..40beb10bcdb
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_onlinealter_encryption.test
@@ -0,0 +1,191 @@
+-- source include/have_innodb.inc
+-- source include/have_example_key_management_plugin.inc
+-- source include/not_valgrind.inc
+-- source include/not_embedded.inc
+-- source include/not_windows.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;
+
+--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 t6_IBD = $MYSQLD_DATADIR/test/t6.ibd
+--let t7_IBD = $MYSQLD_DATADIR/test/t7.ibd
+
+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',42));
+ insert into t2 values (current_num,repeat('temp', 42));
+ 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(15000);
+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 10
+--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 SEARCH_PATTERN=repeat
+--echo # t4 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$t4_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=author
+--echo # t5 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$t5_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=mangled
+--echo # t6 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$t6_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=mysql
+--echo # t7 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$t7_IBD
+-- source include/search_pattern_in_file.inc
+
+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;
+
+--sleep 10
+--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 SEARCH_PATTERN=repeat
+--echo # t4 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$t4_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=author
+--echo # t5 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$t5_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=mangled
+--echo # t6 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$t6_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=mysql
+--echo # t7 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$t7_IBD
+-- source include/search_pattern_in_file.inc
+
+--echo # Restarting server
+-- source include/restart_mysqld.inc
+--echo # Done restarting server
+
+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;
+select count(1) from t6;
+select count(1) from t7;
+
+--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 SEARCH_PATTERN=repeat
+--echo # t4 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$t4_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=author
+--echo # t5 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$t5_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=mangled
+--echo # t6 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$t6_IBD
+-- source include/search_pattern_in_file.inc
+--let SEARCH_PATTERN=mysql
+--echo # t7 ... on expecting NOT FOUND
+-- let SEARCH_FILE=$t7_IBD
+-- source include/search_pattern_in_file.inc
+
+DROP PROCEDURE innodb_insert_proc;
+DROP TABLE t1, t2, t3, t4, t5, t6, t7;
+
+# 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_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..32170567b4c
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_scrub.test
@@ -0,0 +1,156 @@
+-- source include/have_innodb.inc
+-- source include/not_embedded.inc
+-- source include/have_example_key_management_plugin.inc
+-- source include/not_windows.inc
+
+let $MYSQLD_DATADIR=`select @@datadir`;
+let ib1_IBD = $MYSQLD_DATADIR/ibdata1;
+let t1_IBD = $MYSQLD_DATADIR/test/t1.ibd;
+
+create table snapshot_status engine = myisam
+select * from information_schema.global_status
+where variable_name like 'innodb_scrub%';
+
+let $rowcount=500;
+let $formatno = 3;
+while ($formatno)
+{
+let $format = `select case $formatno
+ when 1 then 'dynamic'
+ when 2 then 'redundant'
+ when 3 then 'compact'
+ end`;
+dec $formatno;
+
+-- echo #
+-- echo # Test delete of records
+-- echo #
+
+eval create table t1 (
+ a int auto_increment primary key,
+ b varchar(256),
+ c text) engine = innodb row_format=$format;
+
+let $numinserts = $rowcount;
+-- echo # Populate table with rows
+--disable_query_log
+while ($numinserts)
+{
+ dec $numinserts;
+ insert into t1(b,c) values ('bicycle', repeat('repairman', 1000));
+}
+--enable_query_log
+
+delete from t1;
+
+-- echo # restart mysqld so that all pages are flushed
+-- source include/restart_mysqld.inc
+-- echo # read all rows from table
+-- disable_result_log
+select * from t1;
+-- enable_result_log
+
+-- echo # $format: delete from: grep -c bicycle t1.ibd
+-- exec grep -c bicycle $t1_IBD || true
+-- echo # $format: delete from: grep -c bicycle ibdata1
+-- exec grep -c bicycle $ib1_IBD || true
+-- echo # $format: delete from: grep -c repairman t1.ibd
+-- exec grep -c repairman $t1_IBD || true
+-- echo # $format: delete from: grep -c repairman ibdata1
+-- exec grep -c repairman $ib1_IBD || true
+
+drop table t1;
+
+-- echo #
+-- echo # Test delete+rollback+delete
+-- echo #
+
+eval create table t1 (
+ a int auto_increment primary key,
+ b varchar(256),
+ c text) engine = innodb row_format=$format;
+
+let $numinserts = $rowcount;
+-- echo # Populate table with rows
+--disable_query_log
+while ($numinserts)
+{
+ dec $numinserts;
+ insert into t1(b,c) values ('bicycle', repeat('repairman', 1000));
+}
+--enable_query_log
+
+begin;
+delete from t1;
+rollback;
+delete from t1;
+
+-- echo # restart mysqld so that all pages are flushed
+-- source include/restart_mysqld.inc
+-- echo # read all rows from table
+-- disable_result_log
+select * from t1;
+-- enable_result_log
+
+-- echo # $format: delete rollback: grep -c bicycle t1.ibd
+-- exec grep -c bicycle $t1_IBD || true
+-- echo # $format: delete rollback: grep -c bicycle ibdata1
+-- exec grep -c bicycle $ib1_IBD || true
+-- echo # $format: delete rollback: grep -c repairman t1.ibd
+-- exec grep -c repairman $t1_IBD || true
+-- echo # $format: delete rollback: grep -c repairman ibdata1
+-- exec grep -c repairman $ib1_IBD || true
+
+drop table t1;
+
+-- echo #
+-- echo # Test insert+rollback
+-- echo #
+
+eval create table t1 (
+ a int auto_increment primary key,
+ b varchar(256),
+ c text) engine = innodb row_format=$format;
+
+let $numinserts = $rowcount;
+-- echo # Populate table with rows
+begin;
+--disable_query_log
+while ($numinserts)
+{
+ dec $numinserts;
+ insert into t1(b,c) values ('bicycle', repeat('repairman', 1000));
+}
+--enable_query_log
+
+rollback;
+
+-- echo # restart mysqld so that all pages are flushed
+-- source include/restart_mysqld.inc
+-- echo # read all rows from table
+-- disable_result_log
+select * from t1;
+-- enable_result_log
+
+-- echo # $format: insert rollback: grep -c bicycle t1.ibd
+-- exec grep -c bicycle $t1_IBD || true
+-- echo # $format: insert rollback: grep -c bicycle ibdata1
+-- exec grep -c bicycle $ib1_IBD || true
+-- echo # $format: insert rollback: grep -c repairman t1.ibd
+-- exec grep -c repairman $t1_IBD || true
+-- echo # $format: insert rollback: grep -c repairman ibdata1
+-- exec grep -c repairman $ib1_IBD || true
+
+drop table t1;
+}
+
+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..19e56683117
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_scrub_background.test
@@ -0,0 +1,164 @@
+-- source include/have_innodb.inc
+-- source include/not_embedded.inc
+-- source include/have_example_key_management_plugin.inc
+-- source include/not_windows.inc
+
+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;
+
+--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;
+
+create table snapshot_status engine = myisam
+select * from information_schema.global_status
+where variable_name like 'innodb_scrub%';
+
+let $rowcount=500;
+let $formatno = 1;
+while ($formatno)
+{
+let $format = `select case $formatno
+ when 1 then 'dynamic'
+ when 2 then 'redundant'
+ when 3 then 'compact'
+ when 4 then 'compressed'
+ end`;
+dec $formatno;
+
+truncate table snapshot_status;
+insert into snapshot_status
+select * from information_schema.global_status
+where variable_name like 'innodb_scrub%';
+
+-- echo #
+-- echo # Test delete of records
+-- echo #
+
+eval create table t1 (
+ a int auto_increment primary key,
+ b varchar(256),
+ c text, index(b)) engine = innodb row_format=$format;
+
+let $numinserts = $rowcount;
+-- echo # Populate table with rows
+--disable_query_log
+while ($numinserts)
+{
+ dec $numinserts;
+ insert into t1(b,c) values ('bicycle', repeat('repairman', 1000));
+}
+--enable_query_log
+
+delete from t1;
+
+-- echo #
+-- echo # Test delete+rollback+delete
+-- echo #
+
+eval create table t2 (
+ a int auto_increment primary key,
+ b varchar(256),
+ c text, index(b)) engine = innodb row_format=$format;
+
+let $numinserts = $rowcount;
+-- echo # Populate table with rows
+--disable_query_log
+while ($numinserts)
+{
+ dec $numinserts;
+ insert into t2(b,c) values ('bicycle', repeat('repairman', 1000));
+}
+--enable_query_log
+
+begin;
+delete from t2;
+rollback;
+delete from t2;
+
+-- echo #
+-- echo # Test insert+rollback
+-- echo #
+
+eval create table t3 (
+ a int auto_increment primary key,
+ b varchar(256),
+ c text, index(b)) engine = innodb row_format=$format;
+
+let $numinserts = $rowcount;
+-- echo # Populate table with rows
+begin;
+--disable_query_log
+while ($numinserts)
+{
+ dec $numinserts;
+ insert into t3(b,c) values ('bicycle', repeat('repairman', 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
+}
+
+-- echo # Success!
+-- echo # stop scrubbing threads
+SET GLOBAL innodb_encryption_threads=0;
+
+-- echo # restart mysqld so that all pages are flushed
+-- source include/restart_mysqld.inc
+-- echo # read all rows from table
+-- disable_result_log
+select * from t1;
+-- enable_result_log
+
+-- echo # $format: delete: grep -c bicycle t1.ibd
+-- exec grep -c bicycle $t1_IBD || true
+-- echo # $format: delete: grep -c repairman t1.ibd
+-- exec grep -c repairman $t1_IBD || true
+
+-- echo # $format: delete rollback: grep -c bicycle t2.ibd
+-- exec grep -c bicycle $t2_IBD || true
+-- echo # $format: delete rollback: grep -c repairman t2.ibd
+-- exec grep -c repairman $t2_IBD || true
+
+-- echo # $format: insert rollback: grep -c bicycle t3.ibd
+-- exec grep -c bicycle $t3_IBD || true
+-- echo # $format: insert rollback: grep -c repairman t3.ibd
+-- exec grep -c repairman $t3_IBD || true
+
+drop table t1, t2, t3;
+}
+
+show variables like 'innodb_%scrub_data%';
+
+drop table snapshot_status;
diff --git a/mysql-test/suite/encryption/t/innodb_scrub_compressed.opt b/mysql-test/suite/encryption/t/innodb_scrub_compressed.opt
new file mode 100644
index 00000000000..48b04fa7049
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_scrub_compressed.opt
@@ -0,0 +1,9 @@
+--innodb-file-per-table=1
+--innodb-file-format=Barracuda
+--innodb-immediate-scrub-data-uncompressed=ON
+--innodb-background-scrub-data-uncompressed=ON
+--innodb-background-scrub-data-compressed=ON
+--loose-innodb-debug-force-scrubbing=ON
+--innodb-encrypt-tables=OFF
+--innodb-encrypt-log=OFF
+--innodb-tablespaces-scrubbing
diff --git a/mysql-test/suite/encryption/t/innodb_scrub_compressed.test b/mysql-test/suite/encryption/t/innodb_scrub_compressed.test
new file mode 100644
index 00000000000..d41edac7494
--- /dev/null
+++ b/mysql-test/suite/encryption/t/innodb_scrub_compressed.test
@@ -0,0 +1,161 @@
+-- source include/have_innodb.inc
+-- source include/not_embedded.inc
+-- source include/have_example_key_management_plugin.inc
+-- source include/not_windows.inc
+
+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 $rowcount=500;
+
+-- echo # make sure spaces are checked quickly
+SET GLOBAL innodb_background_scrub_data_check_interval=1;
+
+-- echo #
+-- echo # Test delete of records
+-- echo #
+
+eval create table t1 (
+ a int auto_increment primary key,
+ b varchar(256),
+ c text) engine = innodb row_format=compressed;
+
+let $numinserts = $rowcount;
+-- echo # Populate table with rows
+--disable_query_log
+while ($numinserts)
+{
+ dec $numinserts;
+ insert into t1(b,c) values ('bicycle', repeat('repairman', 1000));
+}
+--enable_query_log
+
+delete from t1;
+
+-- echo #
+-- echo # Test delete+rollback+delete
+-- echo #
+
+eval create table t2 (
+ a int auto_increment primary key,
+ b varchar(256),
+ c text) engine = innodb row_format=compressed;
+
+let $numinserts = $rowcount;
+-- echo # Populate table with rows
+--disable_query_log
+while ($numinserts)
+{
+ dec $numinserts;
+ insert into t2(b,c) values ('boondoggle', repeat('waste of time', 1000));
+}
+--enable_query_log
+
+begin;
+delete from t2;
+rollback;
+delete from t2;
+
+-- echo #
+-- echo # Test insert+rollback
+-- echo #
+
+eval create table t3 (
+ a int auto_increment primary key,
+ b varchar(256),
+ c text) engine = innodb row_format=compressed;
+
+let $numinserts = $rowcount;
+-- echo # Populate table with rows
+begin;
+--disable_query_log
+while ($numinserts)
+{
+ dec $numinserts;
+ insert into t3(b,c) values ('keso', repeat('kent', 1000));
+}
+--enable_query_log
+
+rollback;
+
+-- echo # start scrubbing threads
+SET GLOBAL innodb_encryption_threads=5;
+-- echo # Wait max 10 min for scrubbing of this table
+let $cnt=600;
+while ($cnt)
+{
+ let $success=`SELECT COUNT(*) = 0
+FROM INFORMATION_SCHEMA.INNODB_TABLESPACES_SCRUBBING
+WHERE LAST_SCRUB_COMPLETED IS NULL AND ( NAME like 'test/%' 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
+}
+-- echo # Success!
+-- echo # stop scrubbing threads
+SET GLOBAL innodb_encryption_threads=0;
+
+--echo # Now there should be background scrubs
+let $success=`select sum(variable_value) > 0
+from information_schema.global_status
+where variable_name in ('innodb_scrub_background_page_reorganizations',
+'innodb_scrub_background_page_splits')`;
+
+if (!$success) {
+ show status like 'innodb_scrub%';
+}
+
+-- echo # restart mysqld so that all pages are flushed (encryption off)
+-- echo # so that grep will find stuff
+-- source include/restart_mysqld.inc
+-- echo # read all rows from table
+-- disable_result_log
+select * from t1;
+select * from t2;
+select * from t3;
+-- enable_result_log
+
+-- echo # grep -c bicycle t1.ibd
+-- exec grep -c bicycle $t1_IBD || true
+-- echo # grep -c bicycle ibdata1
+-- exec grep -c bicycle $ib1_IBD || true
+-- echo # grep -c repairman t1.ibd
+-- exec grep -c repairman $t1_IBD || true
+-- echo # grep -c repairman ibdata1
+-- exec grep -c repairman $ib1_IBD || true
+
+-- echo # grep -c boondoggle t2.ibd
+-- exec grep -c boondoggle $t2_IBD || true
+-- echo # grep -c boondoggle ibdata1
+-- exec grep -c boondoggle $ib1_IBD || true
+-- echo # grep -c waste t2.ibd
+-- exec grep -c waste $t2_IBD || true
+-- echo # grep -c waste ibdata1
+-- exec grep -c waste $ib1_IBD || true
+
+-- echo # grep -c keso t3.ibd
+-- exec grep -c keso $t3_IBD || true
+-- echo # grep -c keso ibdata1
+-- exec grep -c keso $ib1_IBD || true
+-- echo # grep -c kent t3.ibd
+-- exec grep -c kent $t3_IBD || true
+-- echo # grep -c kent ibdata1
+-- exec grep -c kent $ib1_IBD || true
+
+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/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/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/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 2114e6f3126..e19f8b4f820 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..ada8110d229 100644
--- a/mysql-test/suite/funcs_1/r/is_columns.result
+++ b/mysql-test/suite/funcs_1/r/is_columns.result
@@ -125,10 +125,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 +139,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 +169,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..2821e1112e5 100644
--- a/mysql-test/suite/funcs_1/r/is_columns_mysql.result
+++ b/mysql-test/suite/funcs_1/r/is_columns_mysql.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) 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 +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') 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 +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') 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
@@ -497,6 +500,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 +570,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..006ed9d82f2 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)
@@ -497,6 +500,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 +570,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_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_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/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..85d8614c91f
--- /dev/null
+++ b/mysql-test/suite/galera/disabled.def
@@ -0,0 +1,29 @@
+galera_wsrep_provider_unset_set : lp1379204 'Unsupported protocol downgrade: incremental data collection disabled. Expect abort.'
+galera_kill_nochanges : mysql-wsrep#24 Galera server does not restart properly if killed
+galera_bf_abort_for_update : mysql-wsrep#26 SELECT FOR UPDATE sometimes allowed to proceed in the face of a concurrent update
+galera_toi_ddl_fk_insert : qa#39 galera_toi_ddl_fk_insert fails sporadically
+galera_binlog_row_image : MDEV-7471 - Enable binlog_row_image parameter in MariaDB
+galera_binlog_rows_query_log_events : Unknown system variable 'binlog_rows_query_log_events' (see annotate_rows_log_event)
+
+galera_ist_mysqldump : Lost connection to MySQL server during query
+galera_ist_xtrabackup-v2 : mysqltest failed but provided no output
+galera_ist_innodb_flush_logs : mysqltest failed but provided no output
+galera_sst_mysqldump : query 'show status' failed with wrong errno 1927
+galera_as_master_gtid : Needs to be re-worked
+galera_as_master_gtid_change_master : Needs to be re-worked
+galera_migrate : query 'let $success= `$wait_condition`' failed: 1146
+galera_var_notify_cmd : Result content mismatch
+query_cache : Fails intermittently due to content mismatch. Needs to be investigated
+basic : Fails intermittently without providing any output. Needs to be investigated
+galera_var_auto_inc_control_on : Failing sporadically with content mismatch
+galera_parallel_simple : Failing sporadically
+galera_bf_abort : Failing sporadically
+galera_log_output_csv : Failing sporadically
+galera_as_slave_preordered : wsrep-preordered is not available in MariaDB Galera cluster
+galera_forced_binlog_format : TODO: investigate
+galera_gra_log : TODO: investigate
+galera_as_slave_replication_bundle : TODO: investigate
+galera_ssl_upgrade : TODO: investigate
+mysql-wsrep#90 : TODO: investigate
+galera_flush : mysql-wsrep/issues/229
+galera_transaction_read_only : mysql-wsrep/issues/229
diff --git a/mysql-test/suite/galera/galera_2nodes.cnf b/mysql-test/suite/galera/galera_2nodes.cnf
new file mode 100644
index 00000000000..f9e5be1901e
--- /dev/null
+++ b/mysql-test/suite/galera/galera_2nodes.cnf
@@ -0,0 +1,40 @@
+# 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-causal-reads=ON
+wsrep-sync-wait=7
+
+[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'
+
+
+[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..68c0cca29a2
--- /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=7
+
+[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=7
+
+[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_slave.cnf b/mysql-test/suite/galera/galera_2nodes_as_slave.cnf
new file mode 100644
index 00000000000..6d71649c274
--- /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=7
+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=7
+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..aed33ba365b
--- /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=7
+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=7
+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=7
+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..c93282e6c47
--- /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=7
+
+[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/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..5f87d23dcc1
--- /dev/null
+++ b/mysql-test/suite/galera/include/galera_sst_set_mysqldump.inc
@@ -0,0 +1,23 @@
+#
+# 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
+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/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..d8a2db99a68
--- /dev/null
+++ b/mysql-test/suite/galera/r/create.result
@@ -0,0 +1,61 @@
+#
+# 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;
+# 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/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_account_management.result b/mysql-test/suite/galera/r/galera_account_management.result
new file mode 100644
index 00000000000..9b3ae9ba46e
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_account_management.result
@@ -0,0 +1,40 @@
+CREATE USER user1, user2 IDENTIFIED BY 'password';
+SELECT COUNT(*) = 2 FROM mysql.user WHERE user IN ('user1', 'user2');
+COUNT(*) = 2
+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_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..cecbfc1f3cf
--- /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 = 7;
+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..ee967356c85
--- /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 = 7;
+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..d87a744000c
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_as_master.result
@@ -0,0 +1,48 @@
+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;
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_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..fd20f8db2f9
--- /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("Send action {\\(nil\\), 328, TORDERED} returned -107 \\(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..c55f1a4dfcb
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_bf_abort.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);
+INSERT INTO t1 VALUES (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..8c07d87eec3
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_bf_abort_flush_for_export.result
@@ -0,0 +1,14 @@
+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;
+SELECT * FROM t1;
+f1
+2
+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_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..10020712286
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_create_function.result
@@ -0,0 +1,55 @@
+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
+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_defaults.result b/mysql-test/suite/galera/r/galera_defaults.result
new file mode 100644
index 00000000000..a0fe1b622e6
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_defaults.result
@@ -0,0 +1,120 @@
+SELECT COUNT(*) = 42 FROM INFORMATION_SCHEMA.GLOBAL_VARIABLES WHERE VARIABLE_NAME LIKE 'wsrep_%';
+COUNT(*) = 42
+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_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 131072
+WSREP_MAX_WS_SIZE 1073741824
+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 7
+<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 = PT15S; evs.info_log_mask = 0; evs.install_timeout = PT7.5S; 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 = PT5S; 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.size = 10M; 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 = P30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT30S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; repl.proto_max = 7; socket.checksum = 2;
+SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS
+WHERE VARIABLE_NAME LIKE 'wsrep_%'
+AND VARIABLE_NAME != 'wsrep_debug_sync_waiters';
+COUNT(*)
+57
+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_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_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..8ff32fdfff4
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_flush.result
@@ -0,0 +1,54 @@
+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
+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;
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..857e44d2dfc
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_forced_binlog_format.result
@@ -0,0 +1,18 @@
+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);
+SHOW BINLOG EVENTS IN 'mysqld-bin.000001' FROM 120;
+Log_name Pos Event_type Server_id End_log_pos Info
+mysqld-bin.000001 <Pos> Query 1 <End_log_pos> use `test`; CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB
+mysqld-bin.000001 <Pos> Query 1 <End_log_pos> BEGIN
+mysqld-bin.000001 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t1)
+mysqld-bin.000001 <Pos> Write_rows 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> Query 1 <End_log_pos> BEGIN
+mysqld-bin.000001 <Pos> Table_map 1 <End_log_pos> table_id: ### (test.t1)
+mysqld-bin.000001 <Pos> Write_rows 1 <End_log_pos> table_id: ### flags: STMT_END_F
+mysqld-bin.000001 <Pos> Xid 1 <End_log_pos> COMMIT /* xid=### */
+DROP TABLE t1;
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..a4879838d11
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_ftwrl_drain.result
@@ -0,0 +1,24 @@
+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;
+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_gcs_fc_limit.result b/mysql-test/suite/galera/r/galera_gcs_fc_limit.result
new file mode 100644
index 00000000000..ad60ead4b8a
--- /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';
+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);
+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_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_insert_ignore.result b/mysql-test/suite/galera/r/galera_insert_ignore.result
new file mode 100644
index 00000000000..b53b5795416
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_insert_ignore.result
@@ -0,0 +1,52 @@
+SET GLOBAL wsrep_sync_wait = 7;
+SET GLOBAL wsrep_sync_wait = 7;
+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..9a5b4e8a76f
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_ist_mysqldump.result
@@ -0,0 +1,284 @@
+Setting SST method to mysqldump ...
+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_restart_joiner.result b/mysql-test/suite/galera/r/galera_ist_restart_joiner.result
new file mode 100644
index 00000000000..f7a1386e7f8
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_ist_restart_joiner.result
@@ -0,0 +1,43 @@
+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;
+SET GLOBAL wsrep_provider_options = 'dbug=d,recv_IST_after_apply_trx';
+SET SESSION wsrep_sync_wait = 0;
+Loading wsrep_provider ...
+SHOW STATUS LIKE 'wsrep_debug_sync_waiters';
+Variable_name Value
+wsrep_debug_sync_waiters recv_IST_after_apply_trx
+UPDATE t1 SET f2 = 'd' WHERE f1 > 3;
+CREATE TABLE t2 (f1 INTEGER);
+UPDATE t1 SET f2 = 'e' WHERE f1 > 4;
+CREATE TABLE t3 (f1 INTEGER);
+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
+SELECT COUNT(*) = 0 FROM t2;
+COUNT(*) = 0
+1
+SELECT COUNT(*) = 0 FROM t3;
+COUNT(*) = 0
+1
+DROP TABLE t1, t2, t3;
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..8dd36497dfb
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_kill_ddl.result
@@ -0,0 +1,11 @@
+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
+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_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..6411a1e3043
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_log_bin.result
@@ -0,0 +1,58 @@
+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: 48 (test.t1)
+mysqld-bin.000002 # Write_rows_v1 # # table_id: 48 flags: STMT_END_F
+mysqld-bin.000002 # Xid # # COMMIT /* xid=2 */
+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: 49 (test.t2)
+mysqld-bin.000002 # Write_rows_v1 # # table_id: 49 flags: STMT_END_F
+mysqld-bin.000002 # Xid # # COMMIT /* xid=4 */
+mysqld-bin.000002 # Gtid # # BEGIN GTID 0-1-5
+mysqld-bin.000002 # Table_map # # table_id: 49 (test.t2)
+mysqld-bin.000002 # Write_rows_v1 # # table_id: 49 flags: STMT_END_F
+mysqld-bin.000002 # Xid # # COMMIT /* xid=5 */
+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: 30 (test.t1)
+mysqld-bin.000003 # Write_rows_v1 # # table_id: 30 flags: STMT_END_F
+mysqld-bin.000003 # Xid # # COMMIT /* xid=2 */
+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: 31 (test.t2)
+mysqld-bin.000003 # Write_rows_v1 # # table_id: 31 flags: STMT_END_F
+mysqld-bin.000003 # Xid # # COMMIT /* xid=4 */
+mysqld-bin.000003 # Gtid # # BEGIN GTID 0-1-5
+mysqld-bin.000003 # Table_map # # table_id: 31 (test.t2)
+mysqld-bin.000003 # Write_rows_v1 # # table_id: 31 flags: STMT_END_F
+mysqld-bin.000003 # Xid # # COMMIT /* xid=5 */
+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;
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..07a78469578
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_log_output_csv.result
@@ -0,0 +1,21 @@
+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 COUNT(*) > 0 FROM mysql.general_log WHERE argument = 'CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB';
+COUNT(*) > 0
+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..a34367d6e46
--- /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 = 7;
+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..d0aa1694e85
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_many_tables_pk.result
@@ -0,0 +1,20 @@
+SELECT COUNT(*) = 900 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%';
+COUNT(*) = 900
+1
+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_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..db4528ac22d
--- /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 = 7;;
+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..294a94baed3
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_parallel_simple.result
@@ -0,0 +1,27 @@
+CREATE TABLE t1 (id INT) ENGINE=InnoDB;
+CREATE TABLE t2 (id INT) ENGINE=InnoDB;
+SET GLOBAL wsrep_slave_threads = 2;
+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);
+SELECT COUNT(*) = 10 FROM t1;
+COUNT(*) = 10
+0
+SELECT COUNT(*) = 10 FROM t2;
+COUNT(*) = 10
+0
+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_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_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..6e245b44462
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_repl_max_ws_size.result
@@ -0,0 +1,8 @@
+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;
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_roles.result b/mysql-test/suite/galera/r/galera_roles.result
new file mode 100644
index 00000000000..c0cdbc0e338
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_roles.result
@@ -0,0 +1,156 @@
+#
+# 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
+ role1 Y
+localhost foo role1 N
+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;
+# 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_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_split_brain.result b/mysql-test/suite/galera/r/galera_split_brain.result
new file mode 100644
index 00000000000..615615040fe
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_split_brain.result
@@ -0,0 +1,5 @@
+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
+SET GLOBAL wsrep_cluster_address = '';
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..c0f2e84dc6f
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_ssl_upgrade.result
@@ -0,0 +1,24 @@
+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
+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
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..e35c4055f45
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_mysqldump.result
@@ -0,0 +1,459 @@
+Setting SST method to mysqldump ...
+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..93557cc91d4
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_mysqldump_with_key.result
@@ -0,0 +1,106 @@
+Setting SST method to mysqldump ...
+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;
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..750d73b615f
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_sst_xtrabackup-v2.result
@@ -0,0 +1,358 @@
+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;
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..02904812dd5
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_suspend_slave.result
@@ -0,0 +1,10 @@
+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 ...
+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_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_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_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_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..54ea8db699d
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_transaction_replay.result
@@ -0,0 +1,30 @@
+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;
+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;
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..8bea105c77e
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_unicode_identifiers.result
@@ -0,0 +1,46 @@
+SET GLOBAL wsrep_sync_wait = 7;
+SET GLOBAL wsrep_sync_wait = 7;
+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..e6f37792569
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_certify_nonPK_off.result
@@ -0,0 +1,21 @@
+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;
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..f8bd869f8fe
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_cluster_address.result
@@ -0,0 +1,51 @@
+SET GLOBAL wsrep_cluster_address = 'foo://';
+SET SESSION wsrep_sync_wait=0;
+SELECT * 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
+SET GLOBAL wsrep_cluster_address = @@wsrep_cluster_address;
+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
+SET GLOBAL wsrep_cluster_address = 'gcomm://192.0.2.1';
+SELECT * 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
+SET GLOBAL wsrep_cluster_address = @@wsrep_cluster_address;
+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
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..0b5f34688b7
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_desync_on.result
@@ -0,0 +1,29 @@
+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
+DROP TABLE t1;
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..6d703c8cf95
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_dirty_reads.result
@@ -0,0 +1,25 @@
+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
+SET @@session.wsrep_dirty_reads=ON;
+SELECT * FROM t1;
+i
+1
+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_size.result b/mysql-test/suite/galera/r/galera_var_max_ws_size.result
new file mode 100644
index 00000000000..d0bf7deafa5
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_max_ws_size.result
@@ -0,0 +1,8 @@
+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
+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..fa88f4b3128
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_node_address.result
@@ -0,0 +1,9 @@
+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..73a0576048b
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_replicate_myisam_on.result
@@ -0,0 +1,78 @@
+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;
+SET GLOBAL wsrep_replicate_myisam = 0;
+SET GLOBAL wsrep_replicate_myisam = 0;
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..603dfaeacc7
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_slave_threads.result
@@ -0,0 +1,114 @@
+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..f6136a4ddc4
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_var_sync_wait.result
@@ -0,0 +1,21 @@
+CREATE TABLE t1 (f1 INT PRIMARY KEY) Engine=InnoDB;
+SET GLOBAL wsrep_sync_wait = 1;
+SHOW TABLES LIKE '%t1';
+Tables_in_test (%t1)
+t1
+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 = 7;
+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_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_unset_set.result b/mysql-test/suite/galera/r/galera_wsrep_provider_unset_set.result
new file mode 100644
index 00000000000..681e4606b38
--- /dev/null
+++ b/mysql-test/suite/galera/r/galera_wsrep_provider_unset_set.result
@@ -0,0 +1,13 @@
+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);
+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/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_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#33.result b/mysql-test/suite/galera/r/mysql-wsrep#33.result
new file mode 100644
index 00000000000..62af519ad32
--- /dev/null
+++ b/mysql-test/suite/galera/r/mysql-wsrep#33.result
@@ -0,0 +1,103 @@
+Setting SST method to mysqldump ...
+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/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..237725ec9a7
--- /dev/null
+++ b/mysql-test/suite/galera/r/sql_log_bin.result
@@ -0,0 +1,52 @@
+
+# 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);
+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..2da2b3ad503
--- /dev/null
+++ b/mysql-test/suite/galera/suite.pm
@@ -0,0 +1,77 @@
+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 ($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: 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: Action message in non-primary configuration from member [0-9]*),
+ );
+
+
+$ENV{PATH}="$epath:$ENV{PATH}";
+$ENV{PATH}="$spath:$ENV{PATH}" unless $epath eq $spath;
+
+bless { };
+
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..fb9b0935288
--- /dev/null
+++ b/mysql-test/suite/galera/t/create.test
@@ -0,0 +1,58 @@
+--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 # 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/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_account_management.test b/mysql-test/suite/galera/t/galera_account_management.test
new file mode 100644
index 00000000000..357319ad106
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_account_management.test
@@ -0,0 +1,101 @@
+#
+# 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
+#
+
+# LP bug 1376269
+#
+#--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_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..6747977812b
--- /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 = 7;
+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..99c45c04ba0
--- /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 = 7;
+
+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..c5d4db9f192
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_master.test
@@ -0,0 +1,62 @@
+#
+# 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;
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_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..b7b656383fd
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_as_slave_nonprim.test
@@ -0,0 +1,95 @@
+#
+# 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
+--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("Send action {\\(nil\\), 328, TORDERED} returned -107 \\(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..7d684cef67d
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.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_autoinc_sst_xtrabackup.test b/mysql-test/suite/galera/t/galera_autoinc_sst_xtrabackup.test
new file mode 100644
index 00000000000..251450f7099
--- /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 IST 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..69825ea4919
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_bf_abort.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
+#
+
+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
+INSERT INTO t1 VALUES (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..dbbe3b3c483
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_bf_abort_flush_for_export.test
@@ -0,0 +1,40 @@
+--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;
+--let $wait_condition = SELECT COUNT(*) = 1 FROM t1
+--source include/wait_condition.inc
+SELECT * 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_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..fd4903a7b83
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_create_function.test
@@ -0,0 +1,57 @@
+--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
+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_defaults.test b/mysql-test/suite/galera/t/galera_defaults.test
new file mode 100644
index 00000000000..1cbb19cc405
--- /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.9
+source ../wsrep/include/check_galera_version.inc;
+--enable_query_log
+
+# Global Variables
+
+SELECT COUNT(*) = 42 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_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..3ba5edbae6f
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_flush.test
@@ -0,0 +1,173 @@
+#
+# 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
+
+#
+# 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
+
+
+#
+# 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;
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..934c15399e0
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_forced_binlog_format.test
@@ -0,0 +1,25 @@
+#
+# 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 120;
+
+DROP TABLE t1;
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..de8310e52d2
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ftwrl.test
@@ -0,0 +1,40 @@
+--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;
+
+SHOW TABLES;
+SELECT COUNT(*) = 1 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_ftwrl_drain.test b/mysql-test/suite/galera/t/galera_ftwrl_drain.test
new file mode 100644
index 00000000000..f022a9437c2
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ftwrl_drain.test
@@ -0,0 +1,68 @@
+#
+# 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
+SET GLOBAL wsrep_provider_options = 'dbug=d,apply_monitor_slave_enter_sync';
+
+--connection node_1
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+SET SESSION wsrep_sync_wait = 0;
+
+# Wait until applier has blocked
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters' AND VARIABLE_VALUE = 'apply_monitor_slave_enter_sync'
+--source include/wait_condition.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
+
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=apply_monitor_slave_enter_sync';
+
+--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_gcs_fc_limit.test b/mysql-test/suite/galera/t/galera_gcs_fc_limit.test
new file mode 100644
index 00000000000..fd77ec0a0eb
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_gcs_fc_limit.test
@@ -0,0 +1,56 @@
+#
+# 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
+FLUSH TABLES WITH READ LOCK;
+
+--connection node_1
+
+INSERT INTO t1 VALUES (2);
+INSERT INTO t1 VALUES (3);
+INSERT INTO t1 VALUES (4);
+
+# 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_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_insert_ignore.test b/mysql-test/suite/galera/t/galera_insert_ignore.test
new file mode 100644
index 00000000000..4b4b0a6e9fb
--- /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 = 7;
+
+--connection node_2
+SET GLOBAL wsrep_sync_wait = 7;
+
+
+#
+# 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..db6b7d5e129
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ist_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;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_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..69446f0f86a
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ist_restart_joiner.test
@@ -0,0 +1,106 @@
+#
+# 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
+
+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
+# Make sure IST will block ...
+SET GLOBAL wsrep_provider_options = 'dbug=d,recv_IST_after_apply_trx';
+SET SESSION wsrep_sync_wait = 0;
+
+
+# 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
+--eval SET GLOBAL wsrep_provider = '$wsrep_provider_orig';
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig';
+--enable_query_log
+
+# We can not use a wait_condition on SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS as such queries are blocked during IST
+# so we perform a simple sleep and SHOW instead
+
+--sleep 5
+SHOW STATUS LIKE 'wsrep_debug_sync_waiters';
+
+--connection node_1
+# Perform DML and DDL while IST is in progress
+--connection node_1
+UPDATE t1 SET f2 = 'd' WHERE f1 > 3;
+CREATE TABLE t2 (f1 INTEGER);
+
+# 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 and DDL while node #2 is down
+UPDATE t1 SET f2 = 'e' WHERE f1 > 4;
+CREATE TABLE t3 (f1 INTEGER);
+
+--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;
+SELECT COUNT(*) = 0 FROM t2;
+SELECT COUNT(*) = 0 FROM t3;
+
+--connection node_1
+DROP TABLE t1, t2, t3;
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..bbe0f6047fb
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ist_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;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_rsync.test b/mysql-test/suite/galera/t/galera_ist_rsync.test
new file mode 100644
index 00000000000..41d1a0c1fc2
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ist_rsync.test
@@ -0,0 +1,8 @@
+--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_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..3c2bce5b9c9
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_kill_ddl.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
+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
+
+SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME='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_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..e36bd7e6025
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_log_bin.test
@@ -0,0 +1,35 @@
+--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 #
+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 #
+SHOW BINLOG EVENTS IN 'mysqld-bin.000003' LIMIT 3,18;
+
+DROP TABLE t1;
+DROP TABLE t2;
+
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..00009396f6a
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_log_output_csv.test
@@ -0,0 +1,27 @@
+#
+# 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
+
+# CREATE TABLE from master is also present in the slave query log, but is logged twice, mysql-wsrep#44
+SELECT COUNT(*) > 0 FROM mysql.general_log WHERE argument = 'CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB';
+
+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..653dc2dd75a
--- /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 = 7;
+
+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..520459e3210
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_many_tables_pk.test
@@ -0,0 +1,104 @@
+--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;
+}
+
+#
+# This test forces 900 tables with 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 and make sure the DDLs are all propagated
+#
+
+--connection node_1
+
+--let $count = 900
+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(*) = 900 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 = 900
+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 = 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_migrate.cnf b/mysql-test/suite/galera/t/galera_migrate.cnf
new file mode 100644
index 00000000000..47bdf53afef
--- /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 = 7
+
+[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..b1dc14deb5b
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_parallel_simple.test
@@ -0,0 +1,45 @@
+#
+# 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;
+
+--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
+
+SELECT COUNT(*) = 10 FROM t1;
+SELECT COUNT(*) = 10 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_pc_ignore_sb.test b/mysql-test/suite/galera/t/galera_pc_ignore_sb.test
new file mode 100644
index 00000000000..f63215ebe4a
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_pc_ignore_sb.test
@@ -0,0 +1,49 @@
+#
+# 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.
+--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`;
+
+--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
+
+--disable_query_log
+# Restore original auto_increment_offset values.
+--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;
+--enable_query_log
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..cb983993b91
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_query_cache-master.opt
@@ -0,0 +1,3 @@
+--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_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..37a2f7d4ce3
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_repl_max_ws_size.test
@@ -0,0 +1,25 @@
+#
+# 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;
+
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..a61332cefd6
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_restart_nochanges.test
@@ -0,0 +1,39 @@
+#
+# 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.
+--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`;
+
+--connection node_1
+CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
+INSERT INTO t1 VALUES (1);
+
+--connection node_2
+--source include/restart_mysqld.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;
+
+--disable_query_log
+# Restore original auto_increment_offset values.
+--connection node_1
+--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_1;
+--connection node_2a
+--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_2;
+--enable_query_log
+
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..f9a15126e5e
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_roles.test
@@ -0,0 +1,167 @@
+#
+# 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
+--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
+
+--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;
+
+--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_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_split_brain.test b/mysql-test/suite/galera/t/galera_split_brain.test
new file mode 100644
index 00000000000..e0298e55422
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_split_brain.test
@@ -0,0 +1,53 @@
+#
+# 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
+
+call mtr.add_suppression("WSREP: TO isolation failed for: ");
+
+--connection node_1
+--let $wsrep_cluster_address_orig = `SELECT @@wsrep_cluster_address`
+
+# Save original auto_increment_offset values.
+--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`;
+
+--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
+
+SET GLOBAL wsrep_cluster_address = '';
+--disable_query_log
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_orig';
+--enable_query_log
+
+--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.
+--disable_query_log
+--connection node_1
+--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_1;
+--connection node_2a
+--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_2;
+--enable_query_log
+
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..8dc94dc1966
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ssl.test
@@ -0,0 +1,24 @@
+#
+# 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
+
+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..cdecf4807d4
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ssl_compression.test
@@ -0,0 +1,34 @@
+#
+# 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
+
+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..07aac0fbe92
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_ssl_upgrade.test
@@ -0,0 +1,46 @@
+#
+# 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
+
+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';
+
+# 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
+
+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';
+
+# 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
+
+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';
+
+# 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..0b3edeb75ff
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_mysqldump_with_key.test
@@ -0,0 +1,22 @@
+#
+# 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;
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..c6823795e59
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_sst_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_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_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..b4302f7d195
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_suspend_slave.test
@@ -0,0 +1,66 @@
+##
+## 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.
+--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`;
+
+--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 -19 $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 -18 $mysqld_pid");
+ exit(0);
+EOF
+
+--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
+
+--source include/wait_until_ready.inc
+SELECT COUNT(*) = 1 FROM t1;
+
+DROP TABLE t1;
+
+--disable_query_log
+# Restore original auto_increment_offset values.
+--connection node_1
+--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_1;
+--connection node_2a
+--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_2;
+--enable_query_log
+
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_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_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_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..632aa5cc0d5
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_transaction_replay.test
@@ -0,0 +1,71 @@
+#
+# 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
+SET GLOBAL wsrep_provider_options = 'dbug=d,commit_monitor_enter_sync';
+
+--connection node_1
+--send COMMIT;
+
+# Wait until commit is blocked
+--connection node_1a
+SET SESSION wsrep_sync_wait = 0;
+--let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters' AND VARIABLE_VALUE = 'commit_monitor_enter_sync'
+--source include/wait_condition.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 = '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
+
+# Unblock the commit
+--connection node_1a
+SET GLOBAL wsrep_provider_options = 'dbug=';
+SET GLOBAL wsrep_provider_options = 'signal=commit_monitor_enter_sync';
+
+# 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;
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..9adac1aa555
--- /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 = 7;
+
+--connection node_2
+SET GLOBAL wsrep_sync_wait = 7;
+
+--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..3e8f3d18859
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_certify_nonPK_off.test
@@ -0,0 +1,39 @@
+#
+# 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;
+
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..dfd84002dd6
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_cluster_address.test
@@ -0,0 +1,110 @@
+#
+# Check the handling of @@wsrep_cluster_address
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+# Save original auto_increment_offset values.
+--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`;
+
+#
+# Set to invalid value
+#
+
+--connection node_1
+--let $wsrep_cluster_address_node1 = `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 * 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_2
+--sleep 1
+# Node #2 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_1
+--disable_query_log
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_node1';
+--enable_query_log
+
+--connection node_2
+SET GLOBAL wsrep_cluster_address = @@wsrep_cluster_address;
+
+--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';
+
+#
+# Set to invalid host
+#
+
+--connection node_1
+SET GLOBAL wsrep_cluster_address = 'gcomm://192.0.2.1';
+
+--error ER_UNKNOWN_COM_ERROR
+SELECT * 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';
+
+#
+# Reset everything as it was
+#
+
+--connection node_1
+--disable_query_log
+--eval SET GLOBAL wsrep_cluster_address = '$wsrep_cluster_address_node1';
+--enable_query_log
+
+--connection node_2
+SET GLOBAL wsrep_cluster_address = @@wsrep_cluster_address;
+--sleep 1
+
+--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';
+
+# 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;
+--enable_query_log
+
+
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..fb0fb9f762a
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_desync_on.test
@@ -0,0 +1,58 @@
+#
+# 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;
+
+DROP TABLE t1;
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..9eea8efdaf3
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_dirty_reads.test
@@ -0,0 +1,62 @@
+#
+# Check the handling of @@wsrep_dirty_reads
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--disable_query_log
+# Save original auto_increment_offset values.
+--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`;
+--enable_query_log
+
+--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 (MDEV-6832).
+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;
+
+SET @@session.wsrep_dirty_reads=ON;
+
+SELECT * FROM t1;
+
+--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
+SELECT * FROM t1;
+# Cleanup
+DROP TABLE t1;
+
+--disable_query_log
+# Restore original auto_increment_offset values.
+--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;
+--enable_query_log
+
+--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_size.test b/mysql-test/suite/galera/t/galera_var_max_ws_size.test
new file mode 100644
index 00000000000..b66ef2d5ee2
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_max_ws_size.test
@@ -0,0 +1,23 @@
+#
+# 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;
+
+--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..cf118cf9934
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_node_address.test
@@ -0,0 +1,22 @@
+#
+# 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
+
+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..9cb0edf1810
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_replicate_myisam_on.test
@@ -0,0 +1,139 @@
+#
+# 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;
+
+--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_slave_threads.test b/mysql-test/suite/galera/t/galera_var_slave_threads.test
new file mode 100644
index 00000000000..50e22fbef66
--- /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
+
+--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..935c271a4d6
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_var_sync_wait.test
@@ -0,0 +1,43 @@
+#
+# Simple test for the various levels of wsrep-sync-wait
+#
+
+--source include/galera_cluster.inc
+--source include/have_innodb.inc
+
+--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
+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..42f63df3acc
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_wan_restart_ist.test
@@ -0,0 +1,148 @@
+#
+# 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);
+
+--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");
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_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_unset_set.test b/mysql-test/suite/galera/t/galera_wsrep_provider_unset_set.test
new file mode 100644
index 00000000000..fe4c358bd89
--- /dev/null
+++ b/mysql-test/suite/galera/t/galera_wsrep_provider_unset_set.test
@@ -0,0 +1,41 @@
+#
+# 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
+
+--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
+
+--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;
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/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_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#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/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..615bc4c30af
--- /dev/null
+++ b/mysql-test/suite/galera/t/sql_log_bin.test
@@ -0,0 +1,44 @@
+# 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.
+
+--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);
+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..fb23a81bfb8
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/disabled.def
@@ -0,0 +1,5 @@
+galera_garbd : Fix the test case
+galera_evs_suspect_timeout : TODO: investigate
+galera_innobackupex_backup : TODO: investigate
+galera_slave_options_do :MDEV-8798
+galera_slave_options_ignore : MDEV-8798
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..2a06c1cd5a9
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/galera_3nodes.cnf
@@ -0,0 +1,60 @@
+# 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=7
+
+[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'
+
+[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/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_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_ist_gcache_rollover.result b/mysql-test/suite/galera_3nodes/r/galera_ist_gcache_rollover.result
new file mode 100644
index 00000000000..1ecea5db5ab
--- /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 = 'signal=ist_sender_send_after_get_buffers';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+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..f5a4cad4a23
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/galera_pc_bootstrap.result
@@ -0,0 +1,29 @@
+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;
+SHOW STATUS LIKE 'wsrep_cluster_status';
+Variable_name Value
+wsrep_cluster_status non-Primary
+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..85f923ad55e
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/r/galera_pc_weight.result
@@ -0,0 +1,119 @@
+SET GLOBAL wsrep_provider_options = 'pc.weight=3';
+Suspending node ...
+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
+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_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/suite.pm b/mysql-test/suite/galera_3nodes/suite.pm
new file mode 100644
index 00000000000..39d5acbcc1b
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/suite.pm
@@ -0,0 +1,53 @@
+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: 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: 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/galera_certification_ccc.test b/mysql-test/suite/galera_3nodes/t/galera_certification_ccc.test
new file mode 100644
index 00000000000..e19169a350c
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_certification_ccc.test
@@ -0,0 +1,60 @@
+#
+# 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.
+--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`;
+--connection node_3
+let $auto_increment_offset_node_3 = `SELECT @@global.auto_increment_offset`;
+
+--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.
+--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;
+--connection node_3
+--eval SET @@global.auto_increment_offset = $auto_increment_offset_node_3;
+--enable_query_log
+
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_innobackupex_backup.test b/mysql-test/suite/galera_3nodes/t/galera_innobackupex_backup.test
new file mode 100644
index 00000000000..af4a5fbf9d6
--- /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 $MYSQL_TMP_DIR/innobackupex_backup --galera-info --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group=mysqld.2 --port=$NODE_MYPORT_2 --host=127.0.0.1 --no-timestamp > $MYSQL_TMP_DIR/innobackupex-backup.log
+--exec innobackupex $MYSQL_TMP_DIR/innobackupex_backup --apply-log --galera-info --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group=mysqld.2 --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 --copy-back $MYSQL_TMP_DIR/innobackupex_backup --defaults-file=$MYSQLTEST_VARDIR/my.cnf --defaults-group=mysqld.2 --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_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..0668c246624
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_ist_gcache_rollover.test
@@ -0,0 +1,98 @@
+#
+# 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 ...
+SET GLOBAL wsrep_provider_options = 'dbug=d,ist_sender_send_after_get_buffers';
+
+# ... 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
+SET GLOBAL wsrep_provider_options = 'signal=ist_sender_send_after_get_buffers';
+SET GLOBAL wsrep_provider_options = 'dbug=';
+
+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
+
+# 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.test b/mysql-test/suite/galera_3nodes/t/galera_pc_bootstrap.test
new file mode 100644
index 00000000000..6172ffcc743
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_pc_bootstrap.test
@@ -0,0 +1,90 @@
+#
+# 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;
+SHOW STATUS LIKE 'wsrep_cluster_status';
+
+# 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.test b/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test
new file mode 100644
index 00000000000..6585f1934a4
--- /dev/null
+++ b/mysql-test/suite/galera_3nodes/t/galera_pc_weight.test
@@ -0,0 +1,123 @@
+#
+# 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
+
+# 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 5
+--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_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/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/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/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/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_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..9e6e5145fa0
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-16k.result
@@ -0,0 +1,979 @@
+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));
+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;
+ERROR HY000: Undo log record is too big.
+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));
+UPDATE t1 SET t=@e;
+ERROR HY000: Undo log record is too big.
+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;
+UPDATE bug12547647 SET c = REPEAT('b',16928);
+ERROR HY000: Undo log record is too big.
+SHOW WARNINGS;
+Level Code Message
+Error 1713 Undo log record is too big.
+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..c9b21bf414a
--- /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;
+INSERT INTO t1 SELECT * from t2;
+SET DEBUG_DBUG='+d,crash_commit_before';
+UPDATE t1 SET a=@e,b=@e,c=@e,d=@e,e=@e;
+ERROR HY000: Lost connection to MySQL server during query
+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..2253ba5588f
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-32k.result
@@ -0,0 +1,868 @@
+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));
+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;
+ERROR HY000: Undo log record is too big.
+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..9371c4a09e5
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-64k-crash.result
@@ -0,0 +1,593 @@
+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;
+SET DEBUG_DBUG='+d,crash_commit_before';
+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;
+ERROR HY000: Lost connection to MySQL server during query
+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..c84ad8caf88
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-64k.result
@@ -0,0 +1,1139 @@
+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;
+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),
+c81 char(143)
+) 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),
+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),
+c81 char(144)
+) 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),
+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));
+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;
+ERROR HY000: Undo log record is too big.
+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 32702. 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-autoinc.result b/mysql-test/suite/innodb/r/innodb-autoinc.result
index 879f9dfa238..ddca4685e05 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-change-buffer-recovery.result b/mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result
index cc2a0373444..96d2a3d462c 100644
--- a/mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result
+++ b/mysql-test/suite/innodb/r/innodb-change-buffer-recovery.result
@@ -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
@@ -33,6 +36,7 @@ INSERT INTO t1 VALUES(1,'X',1);
SET DEBUG_DBUG='+d,crash_after_log_ibuf_upd_inplace';
SELECT b FROM t1 LIMIT 3;
ERROR HY000: Lost connection to MySQL server during query
+FOUND /Wrote log record for ibuf update in place operation/ in my_restart.err
CHECK TABLE t1;
Table Op Msg_type Msg_text
test.t1 check status OK
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-get-fk.result b/mysql-test/suite/innodb/r/innodb-get-fk.result
index 0dca82c2d10..928fa322f81 100644
--- a/mysql-test/suite/innodb/r/innodb-get-fk.result
+++ b/mysql-test/suite/innodb/r/innodb-get-fk.result
@@ -26,7 +26,7 @@ KEY `fk_crewRoleAssigned_roleCode` (`role_code`),
CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB COMMENT="This is a comment about tables";
-# Restart mysqld --innodb_read_only_mode=1
+# Restart mysqld --innodb_read_only=1
SHOW CREATE TABLE `repro`.`crew_role_assigned`;
Table Create Table
crew_role_assigned CREATE TABLE `crew_role_assigned` (
@@ -52,7 +52,7 @@ crew_role_assigned CREATE TABLE `crew_role_assigned` (
CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `crew` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='This is a new comment about tables'
-# Restart mysqld --innodb_read_only_mode=1
+# Restart mysqld --innodb_read_only=1
SHOW CREATE TABLE `repro`.`crew_role_assigned`;
Table Create Table
crew_role_assigned CREATE TABLE `crew_role_assigned` (
diff --git a/mysql-test/suite/innodb/r/innodb-index.result b/mysql-test/suite/innodb/r/innodb-index.result
index 996bc45f7e2..b151e20d321 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-page_compression_bzip2.result b/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result
new file mode 100644
index 00000000000..8d3bc063a71
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_bzip2.result
@@ -0,0 +1,437 @@
+set global innodb_file_format = `barracuda`;
+set global innodb_file_per_table = on;
+set global innodb_compression_algorithm = 5;
+create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
+show warnings;
+Level Code Message
+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;
+set autocommit=0;
+call innodb_insert_proc(5000);
+commit;
+set autocommit=1;
+select count(*) from innodb_normal;
+count(*)
+5000
+insert into innodb_compressed select * from innodb_normal;
+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_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+alter table innodb_normal page_compressed=1 page_compression_level=8;
+show warnings;
+Level Code Message
+show create table innodb_normal;
+Table Create Table
+innodb_normal CREATE TABLE `innodb_normal` (
+ `c1` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
+show warnings;
+Level Code Message
+show create table innodb_compressed;
+Table Create Table
+innodb_compressed CREATE TABLE `innodb_compressed` (
+ `c1` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
+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 count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+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 count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+set global innodb_compression_algorithm = 1;
+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;
+commit;
+select count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+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 count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+set global innodb_compression_algorithm = 0;
+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;
+commit;
+select count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+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 count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compressed;
+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/r/innodb-page_compression_lz4.result b/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result
new file mode 100644
index 00000000000..eeab2622cb6
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_lz4.result
@@ -0,0 +1,438 @@
+set global innodb_file_format = `barracuda`;
+set global innodb_file_per_table = on;
+set global innodb_compression_algorithm = 2;
+create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
+show warnings;
+Level Code Message
+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;
+set autocommit=0;
+call innodb_insert_proc(5000);
+commit;
+set autocommit=1;
+select count(*) from innodb_normal;
+count(*)
+5000
+insert into innodb_compressed select * from innodb_normal;
+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_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+alter table innodb_normal page_compressed=1 page_compression_level=8;
+show warnings;
+Level Code Message
+show create table innodb_normal;
+Table Create Table
+innodb_normal CREATE TABLE `innodb_normal` (
+ `c1` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
+show warnings;
+Level Code Message
+show create table innodb_compressed;
+Table Create Table
+innodb_compressed CREATE TABLE `innodb_compressed` (
+ `c1` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
+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;
+commit;
+select count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+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 count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+set global innodb_compression_algorithm = 1;
+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;
+commit;
+select count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+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 count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+set global innodb_compression_algorithm = 0;
+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;
+commit;
+select count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+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 count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compressed;
+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/r/innodb-page_compression_lzma.result b/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result
new file mode 100644
index 00000000000..d340801b656
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_lzma.result
@@ -0,0 +1,437 @@
+set global innodb_file_format = `barracuda`;
+set global innodb_file_per_table = on;
+set global innodb_compression_algorithm = 4;
+create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
+show warnings;
+Level Code Message
+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;
+set autocommit=0;
+call innodb_insert_proc(5000);
+commit;
+set autocommit=1;
+select count(*) from innodb_normal;
+count(*)
+5000
+insert into innodb_compressed select * from innodb_normal;
+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_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+alter table innodb_normal page_compressed=1 page_compression_level=8;
+show warnings;
+Level Code Message
+show create table innodb_normal;
+Table Create Table
+innodb_normal CREATE TABLE `innodb_normal` (
+ `c1` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
+show warnings;
+Level Code Message
+show create table innodb_compressed;
+Table Create Table
+innodb_compressed CREATE TABLE `innodb_compressed` (
+ `c1` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
+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 count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+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 count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+set global innodb_compression_algorithm = 1;
+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;
+commit;
+select count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+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 count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+set global innodb_compression_algorithm = 0;
+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;
+commit;
+select count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+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 count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compressed;
+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/r/innodb-page_compression_lzo.result b/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result
new file mode 100644
index 00000000000..fdbc99f60d9
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_lzo.result
@@ -0,0 +1,351 @@
+set global innodb_file_format = `barracuda`;
+set global innodb_file_per_table = on;
+set global innodb_compression_algorithm = 3;
+create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
+show warnings;
+Level Code Message
+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;
+set autocommit=0;
+call innodb_insert_proc(5000);
+commit;
+set autocommit=1;
+select count(*) from innodb_normal;
+count(*)
+5000
+insert into innodb_compressed select * from innodb_normal;
+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_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+alter table innodb_normal page_compressed=1 page_compression_level=8;
+show warnings;
+Level Code Message
+show create table innodb_normal;
+Table Create Table
+innodb_normal CREATE TABLE `innodb_normal` (
+ `c1` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
+show warnings;
+Level Code Message
+show create table innodb_compressed;
+Table Create Table
+innodb_compressed CREATE TABLE `innodb_compressed` (
+ `c1` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
+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 count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+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 count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+set global innodb_compression_algorithm = 1;
+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;
+commit;
+select count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+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 count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compressed;
+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/r/innodb-page_compression_snappy.result b/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result
new file mode 100644
index 00000000000..a0b2f947fd3
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_snappy.result
@@ -0,0 +1,438 @@
+call mtr.add_suppression("Compression failed for space*");
+set global innodb_file_format = `barracuda`;
+set global innodb_file_per_table = on;
+set global innodb_compression_algorithm = 6;
+create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
+show warnings;
+Level Code Message
+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;
+set autocommit=0;
+call innodb_insert_proc(5000);
+commit;
+set autocommit=1;
+select count(*) from innodb_normal;
+count(*)
+5000
+insert into innodb_compressed select * from innodb_normal;
+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_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+alter table innodb_normal page_compressed=1 page_compression_level=8;
+show warnings;
+Level Code Message
+show create table innodb_normal;
+Table Create Table
+innodb_normal CREATE TABLE `innodb_normal` (
+ `c1` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
+show warnings;
+Level Code Message
+show create table innodb_compressed;
+Table Create Table
+innodb_compressed CREATE TABLE `innodb_compressed` (
+ `c1` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
+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 count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+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 count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+set global innodb_compression_algorithm = 1;
+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;
+commit;
+select count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+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 count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+set global innodb_compression_algorithm = 0;
+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;
+commit;
+select count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+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 count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compressed;
+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/r/innodb-page_compression_tables.result b/mysql-test/suite/innodb/r/innodb-page_compression_tables.result
new file mode 100644
index 00000000000..98de5db3c12
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_tables.result
@@ -0,0 +1,121 @@
+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: Can't create table `test`.`#sql-temporary` (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`.`#sql-temporary` (errno: 140 "Wrong create options")
+Warning 1030 Got error 140 "Wrong create options" from storage engine InnoDB
+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..4c3ab273b2e
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb-page_compression_zip.result
@@ -0,0 +1,351 @@
+SET GLOBAL innodb_file_format = `Barracuda`;
+SET GLOBAL innodb_file_per_table = ON;
+set global innodb_compression_algorithm = 1;
+create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
+show warnings;
+Level Code Message
+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;
+set autocommit=0;
+call innodb_insert_proc(5000);
+commit;
+set autocommit=1;
+select count(*) from innodb_normal;
+count(*)
+5000
+insert into innodb_compressed select * from innodb_normal;
+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_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+alter table innodb_normal page_compressed=1 page_compression_level=8;
+show warnings;
+Level Code Message
+show create table innodb_normal;
+Table Create Table
+innodb_normal CREATE TABLE `innodb_normal` (
+ `c1` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
+show warnings;
+Level Code Message
+show create table innodb_compressed;
+Table Create Table
+innodb_compressed CREATE TABLE `innodb_compressed` (
+ `c1` int(11) DEFAULT NULL,
+ `b` char(20) DEFAULT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 `page_compressed`=1 `page_compression_level`=8
+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 count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+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 count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+set global innodb_compression_algorithm = 0;
+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;
+commit;
+select count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+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 count(*) from innodb_compressed;
+count(*)
+5000
+select count(*) from innodb_page_compressed1;
+count(*)
+5000
+select count(*) from innodb_page_compressed1 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed2 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed3 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed4 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed5 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed6 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed7 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed8 where c1 < 500000;
+count(*)
+5000
+select count(*) from innodb_page_compressed9 where c1 < 500000;
+count(*)
+5000
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compressed;
+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/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.result b/mysql-test/suite/innodb/r/innodb.result
index f8020e080e6..3813cfcda14 100644
--- a/mysql-test/suite/innodb/r/innodb.result
+++ b/mysql-test/suite/innodb/r/innodb.result
@@ -719,7 +719,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
@@ -2484,7 +2485,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..bd3c388fae1 100644
--- a/mysql-test/suite/innodb/r/innodb_bug14147491.result
+++ b/mysql-test/suite/innodb/r/innodb_bug14147491.result
@@ -1,5 +1,16 @@
+call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed.*");
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: Database page corruption on disk or a failed");
+CALL mtr.add_suppression("InnoDB: Space .* file test/t1 read of page .*");
+CALL mtr.add_suppression("InnoDB: You may have to recover from a backup.");
+CALL mtr.add_suppression("InnoDB: It is also possible that your operatingsystem has corrupted its own file cache.");
+CALL mtr.add_suppression("InnoDB: and rebooting your computer removes the error.");
+CALL mtr.add_suppression("InnoDB: If the corrupt page is an index page you can also try to");
+CALL mtr.add_suppression("InnoDB: fix the corruption by dumping, dropping, and reimporting");
+CALL mtr.add_suppression("InnoDB: the corrupt table. You can use CHECK");
+CALL mtr.add_suppression("InnoDB: TABLE to scan your table for corruption.");
+CALL mtr.add_suppression("InnoDB: See also .* about forcing recovery.");
# Create and populate the table to be corrupted
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
INSERT INTO t1 (b) VALUES ('corrupt me');
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_bug59641.result b/mysql-test/suite/innodb/r/innodb_bug59641.result
index 5062c69558b..9c5d363e5fe 100644
--- a/mysql-test/suite/innodb/r/innodb_bug59641.result
+++ b/mysql-test/suite/innodb/r/innodb_bug59641.result
@@ -42,9 +42,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_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..5f3fd523946
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_defragment.result
@@ -0,0 +1,125 @@
+DROP TABLE if exists t1;
+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..04e41046a6a
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_defragment_fill_factor.result
@@ -0,0 +1,76 @@
+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), 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;
+optimize table t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+select sleep(1);
+sleep(1)
+0
+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));
+insert into t1 values (83, REPEAT('A', 256));
+insert into t1 values (87, REPEAT('A', 256));
+insert into t1 values (82, REPEAT('A', 256));
+insert into t1 values (86, REPEAT('A', 256));
+# More insertions will cause page splits
+insert into t1 values (88, REPEAT('A', 256));
+insert into t1 values (85, REPEAT('A', 256));
+insert into t1 values (84, REPEAT('A', 256));
+DROP TABLE t1;
+Testing table with small records
+CREATE TABLE t2 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b VARchar(16), KEY SECOND(a,b)) ENGINE=INNODB;
+optimize table t2;
+Table Op Msg_type Msg_text
+test.t2 optimize status OK
+select sleep(1);
+sleep(1)
+0
+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));
+insert into t2 values(1191, REPEAT('A', 16));
+insert into t2 values(1182, REPEAT('A', 16));
+insert into t2 values(1192, REPEAT('A', 16));
+insert into t2 values(1183, REPEAT('A', 16));
+insert into t2 values(1193, REPEAT('A', 16));
+insert into t2 values(1184, REPEAT('A', 16));
+insert into t2 values(1194, REPEAT('A', 16));
+insert into t2 values(1185, REPEAT('A', 16));
+insert into t2 values(1195, REPEAT('A', 16));
+insert into t2 values(1186, REPEAT('A', 16));
+insert into t2 values(1196, REPEAT('A', 16));
+insert into t2 values(1187, REPEAT('A', 16));
+insert into t2 values(1197, REPEAT('A', 16));
+insert into t2 values(1188, REPEAT('A', 16));
+insert into t2 values(1198, REPEAT('A', 16));
+insert into t2 values(1189, REPEAT('A', 16));
+insert into t2 values(1199, REPEAT('A', 16));
+insert into t2 values(1190, REPEAT('A', 16));
+insert into t2 values(1180, REPEAT('A', 16));
+More insertions will cause page split.
+insert into t2 values(1280, REPEAT('A', 16));
+insert into t2 values(1290, REPEAT('A', 16));
+insert into t2 values(1281, REPEAT('A', 16));
+insert into t2 values(1291, REPEAT('A', 16));
+DROP TABLE t2;
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 21c1234d7d3..fc13ba1ab2c 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_monitor.result b/mysql-test/suite/innodb/r/innodb_monitor.result
index f8d24f4e6f5..8c580348e1a 100644
--- a/mysql-test/suite/innodb/r/innodb_monitor.result
+++ b/mysql-test/suite/innodb/r/innodb_monitor.result
@@ -37,7 +37,11 @@ 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_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 +72,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 +167,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 +215,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..db7be5c9586
--- /dev/null
+++ b/mysql-test/suite/innodb/r/innodb_skip_innodb_is_tables.result
@@ -0,0 +1,393 @@
+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_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
+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..b1f618c5221 100644
--- a/mysql-test/suite/innodb/r/innodb_uninstall.result
+++ b/mysql-test/suite/innodb/r/innodb_uninstall.result
@@ -1,4 +1,6 @@
install plugin innodb soname 'ha_innodb';
+Warnings:
+Warning 1105 Cannot enable tc-log at run-time. XA features of InnoDB are disabled
create table t1(a int not null primary key) engine=innodb;
begin;
insert into t1 values(1);
@@ -9,8 +11,10 @@ sleep(1)
0
Warnings:
Warning 1620 Plugin is busy and will be uninstalled on shutdown
-drop table t1;
install plugin innodb soname 'ha_innodb';
+Warnings:
+Warning 1105 Cannot enable tc-log at run-time. XA features of InnoDB are disabled
+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/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/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_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..3cd90a00d55
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-16k.test
@@ -0,0 +1,977 @@
+--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));
+--error 1713
+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;
+
+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));
+--error 1713
+UPDATE t1 SET t=@e;
+
+# 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.
+--error 1713
+UPDATE bug12547647 SET c = REPEAT('b',16928);
+SHOW WARNINGS;
+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..3a0fcd48577
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-32k-crash-master.opt
@@ -0,0 +1 @@
+--default_storage_engine=InnoDB --innodb-buffer-pool-size=24M
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..8f2e7d6c1e2
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-32k-crash.test
@@ -0,0 +1,222 @@
+--source include/have_innodb.inc
+--source include/have_innodb_32k.inc
+--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
+
+call mtr.add_suppression("InnoDB: Warning: innodb_page_size has been changed from default value *");
+
+--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;
+
+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;
+
+INSERT INTO t1 SELECT * from t2;
+
+SET DEBUG_DBUG='+d,crash_commit_before';
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--error 2013
+UPDATE t1 SET a=@e,b=@e,c=@e,d=@e,e=@e;
+
+# Write file to make mysql-test-run.pl restart the server
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+--disable_reconnect
+
+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;
+
+#
+# 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-master.opt b/mysql-test/suite/innodb/t/innodb-32k-master.opt
new file mode 100644
index 00000000000..9c4099c7f24
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-32k-master.opt
@@ -0,0 +1,3 @@
+--default_storage_engine=InnoDB
+--innodb-buffer-pool-size=24M
+
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..65c1d4bbc76
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-32k.test
@@ -0,0 +1,769 @@
+--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));
+
+--error 1713
+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;
+
+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..3a0fcd48577
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-64k-crash-master.opt
@@ -0,0 +1 @@
+--default_storage_engine=InnoDB --innodb-buffer-pool-size=24M
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..9d2d0d66415
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-64k-crash.test
@@ -0,0 +1,412 @@
+--source include/have_innodb.inc
+--source include/have_innodb_64k.inc
+--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
+
+call mtr.add_suppression("InnoDB: Warning: innodb_page_size has been changed from default value *");
+
+--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;
+
+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;
+
+
+SET DEBUG_DBUG='+d,crash_commit_before';
+--exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
+--error 2013
+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;
+
+# Write file to make mysql-test-run.pl restart the server
+--enable_reconnect
+--source include/wait_until_connected_again.inc
+--disable_reconnect
+
+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;
+
+#
+# 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-master.opt b/mysql-test/suite/innodb/t/innodb-64k-master.opt
new file mode 100644
index 00000000000..9c4099c7f24
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-64k-master.opt
@@ -0,0 +1,3 @@
+--default_storage_engine=InnoDB
+--innodb-buffer-pool-size=24M
+
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..bd0da6b66ad
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-64k.test
@@ -0,0 +1,723 @@
+--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;
+
+# Redundant table; 32698 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),
+c81 char(143)
+) 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),
+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),
+c81 char(144)
+) ROW_FORMAT=redundant;
+
+# 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));
+
+--error 1713
+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;
+
+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-autoinc.test b/mysql-test/suite/innodb/t/innodb-autoinc.test
index 362be2e055b..dd4c4ae8603 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..8aa113fc3ca 100644
--- a/mysql-test/suite/innodb/t/innodb-blob.test
+++ b/mysql-test/suite/innodb/t/innodb-blob.test
@@ -3,6 +3,7 @@
# 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
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..79f7999d115 100644
--- a/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test
+++ b/mysql-test/suite/innodb/t/innodb-change-buffer-recovery.test
@@ -46,6 +46,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;
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-get-fk.test b/mysql-test/suite/innodb/t/innodb-get-fk.test
index 4245bef289f..3e330ffeda3 100644
--- a/mysql-test/suite/innodb/t/innodb-get-fk.test
+++ b/mysql-test/suite/innodb/t/innodb-get-fk.test
@@ -33,19 +33,20 @@ CONSTRAINT `fk_crewRoleAssigned_crewId` FOREIGN KEY (`crew_id`) REFERENCES `repr
CONSTRAINT `fk_crewRoleAssigned_pilotId` FOREIGN KEY (`crew_id`) REFERENCES `repro`.`pilot` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB COMMENT="This is a comment about tables";
---echo # Restart mysqld --innodb_read_only_mode=1
--- let $restart_parameters=--innodb-read-only-mode=1
+--echo # Restart mysqld --innodb_read_only=1
+-- let $restart_parameters=--innodb-read-only=1
-- source include/restart_mysqld.inc
SHOW CREATE TABLE `repro`.`crew_role_assigned`;
+-- let $restart_parameters=
-- source include/restart_mysqld.inc
ALTER TABLE `repro`.`crew_role_assigned` COMMENT = "This is a new comment about tables";
SHOW CREATE TABLE `repro`.`crew_role_assigned`;
---echo # Restart mysqld --innodb_read_only_mode=1
--- let $restart_parameters=--innodb-read-only-mode=1
+--echo # Restart mysqld --innodb_read_only=1
+-- let $restart_parameters=--innodb-read-only=1
-- source include/restart_mysqld.inc
#
@@ -53,6 +54,7 @@ SHOW CREATE TABLE `repro`.`crew_role_assigned`;
#
SHOW CREATE TABLE `repro`.`crew_role_assigned`;
+-- let $restart_parameters=
-- source include/restart_mysqld.inc
DROP TABLE `repro`.`crew_role_assigned`;
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..51493266a60
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_bzip2.test
@@ -0,0 +1,252 @@
+-- source include/have_innodb.inc
+-- source include/have_innodb_bzip2.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;
+
+# bzip2
+set global innodb_compression_algorithm = 5;
+
+create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
+show warnings;
+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;
+
+set autocommit=0;
+call innodb_insert_proc(5000);
+commit;
+set autocommit=1;
+select count(*) from innodb_normal;
+insert into innodb_compressed select * from innodb_normal;
+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_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+alter table innodb_normal page_compressed=1 page_compression_level=8;
+show warnings;
+show create table innodb_normal;
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
+show warnings;
+show create table innodb_compressed;
+
+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 count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+--source include/restart_mysqld.inc
+
+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 count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+# zlib
+set global innodb_compression_algorithm = 1;
+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;
+commit;
+select count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+--source include/restart_mysqld.inc
+
+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 count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+# none
+set global innodb_compression_algorithm = 0;
+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;
+commit;
+select count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+--source include/restart_mysqld.inc
+
+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 count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compressed;
+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;
+--enable_query_log
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..f36ea9684e9
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_lz4.test
@@ -0,0 +1,253 @@
+-- source include/have_innodb.inc
+-- source include/have_innodb_lz4.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;
+
+# lz4
+set global innodb_compression_algorithm = 2;
+
+create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
+show warnings;
+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;
+
+set autocommit=0;
+call innodb_insert_proc(5000);
+commit;
+set autocommit=1;
+select count(*) from innodb_normal;
+insert into innodb_compressed select * from innodb_normal;
+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_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+alter table innodb_normal page_compressed=1 page_compression_level=8;
+show warnings;
+show create table innodb_normal;
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
+show warnings;
+show create table innodb_compressed;
+
+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;
+commit;
+select count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+--source include/restart_mysqld.inc
+
+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 count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+# zlib
+set global innodb_compression_algorithm = 1;
+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;
+commit;
+select count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+--source include/restart_mysqld.inc
+
+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 count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+# none
+set global innodb_compression_algorithm = 0;
+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;
+commit;
+select count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+--source include/restart_mysqld.inc
+
+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 count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compressed;
+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;
+--enable_query_log
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..6ea686bca04
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_lzma.test
@@ -0,0 +1,252 @@
+-- source include/have_innodb.inc
+-- source include/have_innodb_lzma.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;
+
+# lzma
+set global innodb_compression_algorithm = 4;
+
+create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
+show warnings;
+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;
+
+set autocommit=0;
+call innodb_insert_proc(5000);
+commit;
+set autocommit=1;
+select count(*) from innodb_normal;
+insert into innodb_compressed select * from innodb_normal;
+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_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+alter table innodb_normal page_compressed=1 page_compression_level=8;
+show warnings;
+show create table innodb_normal;
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
+show warnings;
+show create table innodb_compressed;
+
+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 count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+--source include/restart_mysqld.inc
+
+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 count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+# zlib
+set global innodb_compression_algorithm = 1;
+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;
+commit;
+select count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+--source include/restart_mysqld.inc
+
+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 count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+# none
+set global innodb_compression_algorithm = 0;
+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;
+commit;
+select count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+--source include/restart_mysqld.inc
+
+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 count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compressed;
+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;
+--enable_query_log
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..96ba18f5112
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_lzo.test
@@ -0,0 +1,206 @@
+-- source include/have_innodb.inc
+-- source include/have_innodb_lzo.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;
+
+# lzo
+set global innodb_compression_algorithm = 3;
+
+create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
+show warnings;
+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;
+
+set autocommit=0;
+call innodb_insert_proc(5000);
+commit;
+set autocommit=1;
+select count(*) from innodb_normal;
+insert into innodb_compressed select * from innodb_normal;
+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_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+alter table innodb_normal page_compressed=1 page_compression_level=8;
+show warnings;
+show create table innodb_normal;
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
+show warnings;
+show create table innodb_compressed;
+
+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 count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+--source include/restart_mysqld.inc
+
+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 count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+# zlib
+set global innodb_compression_algorithm = 1;
+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;
+commit;
+select count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+--source include/restart_mysqld.inc
+
+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 count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compressed;
+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;
+--enable_query_log
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..929f547b6ac
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_snappy.test
@@ -0,0 +1,253 @@
+-- source include/have_innodb.inc
+-- source include/have_innodb_snappy.inc
+
+call mtr.add_suppression("Compression failed for space*");
+
+--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;
+
+# snappy
+set global innodb_compression_algorithm = 6;
+
+create table innodb_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
+show warnings;
+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;
+
+set autocommit=0;
+call innodb_insert_proc(5000);
+commit;
+set autocommit=1;
+select count(*) from innodb_normal;
+insert into innodb_compressed select * from innodb_normal;
+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_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+alter table innodb_normal page_compressed=1 page_compression_level=8;
+show warnings;
+show create table innodb_normal;
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
+show warnings;
+show create table innodb_compressed;
+
+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 count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+--source include/restart_mysqld.inc
+
+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 count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+# zlib
+set global innodb_compression_algorithm = 1;
+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;
+commit;
+select count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+--source include/restart_mysqld.inc
+
+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 count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+# none
+set global innodb_compression_algorithm = 0;
+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;
+commit;
+select count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+--source include/restart_mysqld.inc
+
+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 count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compressed;
+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;
+--enable_query_log
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..41d844d26b4
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_tables.test
@@ -0,0 +1,103 @@
+--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;
+--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
+--error 1005
+alter table innodb_redundant page_compressed=1;
+--replace_regex /#sql-[0-9a-f_]*`/#sql-temporary`/
+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..67fafdb9e83
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb-page_compression_zip.test
@@ -0,0 +1,203 @@
+--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_compressed(c1 int, b char(20)) engine=innodb row_format=compressed key_block_size=8;
+show warnings;
+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;
+
+set autocommit=0;
+call innodb_insert_proc(5000);
+commit;
+set autocommit=1;
+select count(*) from innodb_normal;
+insert into innodb_compressed select * from innodb_normal;
+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_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+alter table innodb_normal page_compressed=1 page_compression_level=8;
+show warnings;
+show create table innodb_normal;
+alter table innodb_compressed row_format=default page_compressed=1 page_compression_level=8 key_block_size=0;
+show warnings;
+show create table innodb_compressed;
+
+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 count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+--source include/restart_mysqld.inc
+
+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 count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+# none
+set global innodb_compression_algorithm = 0;
+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;
+commit;
+select count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+--source include/restart_mysqld.inc
+
+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 count(*) from innodb_compressed;
+select count(*) from innodb_page_compressed1;
+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;
+
+drop procedure innodb_insert_proc;
+drop table innodb_normal;
+drop table innodb_compressed;
+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;
+--enable_query_log
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 b519c48b23d..2e7306c8e29 100644
--- a/mysql-test/suite/innodb/t/innodb.test
+++ b/mysql-test/suite/innodb/t/innodb.test
@@ -14,6 +14,7 @@
#######################################################################
-- source include/have_innodb.inc
+-- source include/have_innodb_16k.inc
let $MYSQLD_DATADIR= `select @@datadir`;
@@ -456,7 +457,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;
@@ -1314,7 +1316,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';
@@ -1550,7 +1552,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 6f0bfca8e1d..16e88826c85 100644
--- a/mysql-test/suite/innodb/t/innodb_bug14147491.test
+++ b/mysql-test/suite/innodb/t/innodb_bug14147491.test
@@ -2,6 +2,10 @@
# Test opening a corrupted table.
#
+-- source include/not_encrypted.inc
+
+call mtr.add_suppression("InnoDB: Database page corruption on disk or a failed.*");
+
# Don't test under valgrind, memory leaks will occur
source include/not_valgrind.inc;
# Avoid CrashReporter popup on Mac
@@ -18,6 +22,17 @@ 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");
+CALL mtr.add_suppression("InnoDB: Database page corruption on disk or a failed");
+CALL mtr.add_suppression("InnoDB: Space .* file test/t1 read of page .*");
+CALL mtr.add_suppression("InnoDB: You may have to recover from a backup.");
+CALL mtr.add_suppression("InnoDB: It is also possible that your operatingsystem has corrupted its own file cache.");
+CALL mtr.add_suppression("InnoDB: and rebooting your computer removes the error.");
+CALL mtr.add_suppression("InnoDB: If the corrupt page is an index page you can also try to");
+CALL mtr.add_suppression("InnoDB: fix the corruption by dumping, dropping, and reimporting");
+CALL mtr.add_suppression("InnoDB: the corrupt table. You can use CHECK");
+CALL mtr.add_suppression("InnoDB: TABLE to scan your table for corruption.");
+CALL mtr.add_suppression("InnoDB: See also .* about forcing recovery.");
+
--echo # Create and populate the table to be corrupted
CREATE TABLE t1 (a INT AUTO_INCREMENT PRIMARY KEY, b TEXT) ENGINE=InnoDB;
diff --git a/mysql-test/suite/innodb/t/innodb_bug59641.test b/mysql-test/suite/innodb/t/innodb_bug59641.test
index a8d35cd1029..bca3f4a92c1 100644
--- a/mysql-test/suite/innodb/t/innodb_bug59641.test
+++ b/mysql-test/suite/innodb/t/innodb_bug59641.test
@@ -62,6 +62,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-master.opt b/mysql-test/suite/innodb/t/innodb_defragment-master.opt
new file mode 100644
index 00000000000..6fc7f343b24
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_defragment-master.opt
@@ -0,0 +1,2 @@
+--innodb_file_per_table
+--innodb-defragment=1 \ No newline at end of file
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..6426bac41a0
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_defragment.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.test b/mysql-test/suite/innodb/t/innodb_defragment.test
new file mode 100644
index 00000000000..22b72a4aa6b
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_defragment.test
@@ -0,0 +1,170 @@
+--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
+
+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
+while ($i)
+{
+ eval
+ INSERT INTO t1 VALUES ($data_size + 1 - $i, REPEAT('A', 256));
+ dec $i;
+}
+--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;
+
+# 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_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..a46ca124f51
--- /dev/null
+++ b/mysql-test/suite/innodb/t/innodb_defragment_fill_factor.test
@@ -0,0 +1,166 @@
+--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), KEY SECOND(a, b)) ENGINE=INNODB;
+
+# Populate table.
+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;
+
+--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/restart_mysqld.inc
+optimize table t1;
+select sleep(1);
+
+--source include/restart_mysqld.inc
+select count(*) from t1;
+
+# After deletion & defragmentation, there are 800 records left. Each page can hold about 57 records. We fill the page 90% full,
+# so there should be less than 16 pages total.
+--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);
+
+# secondary index is slightly bigger than primary index so the number of pages should be similar.
+--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));
+insert into t1 values (83, REPEAT('A', 256));
+insert into t1 values (87, REPEAT('A', 256));
+insert into t1 values (82, REPEAT('A', 256));
+insert into t1 values (86, REPEAT('A', 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 # More insertions will cause page splits
+insert into t1 values (88, REPEAT('A', 256));
+insert into t1 values (85, REPEAT('A', 256));
+insert into t1 values (84, REPEAT('A', 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 much space are reserved on primary index.
+}
+
+if ($second_before == $second_after) {
+ --echo Too much space are 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), KEY SECOND(a,b)) ENGINE=INNODB;
+# Populate table.
+--disable_query_log
+INSERT INTO t2 VALUES (1, REPEAT('A', 16));
+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/restart_mysqld.inc
+optimize table t2;
+select sleep(1);
+
+--source include/restart_mysqld.inc
+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));
+insert into t2 values(1191, REPEAT('A', 16));
+insert into t2 values(1182, REPEAT('A', 16));
+insert into t2 values(1192, REPEAT('A', 16));
+insert into t2 values(1183, REPEAT('A', 16));
+insert into t2 values(1193, REPEAT('A', 16));
+insert into t2 values(1184, REPEAT('A', 16));
+insert into t2 values(1194, REPEAT('A', 16));
+insert into t2 values(1185, REPEAT('A', 16));
+insert into t2 values(1195, REPEAT('A', 16));
+insert into t2 values(1186, REPEAT('A', 16));
+insert into t2 values(1196, REPEAT('A', 16));
+insert into t2 values(1187, REPEAT('A', 16));
+insert into t2 values(1197, REPEAT('A', 16));
+insert into t2 values(1188, REPEAT('A', 16));
+insert into t2 values(1198, REPEAT('A', 16));
+insert into t2 values(1189, REPEAT('A', 16));
+insert into t2 values(1199, REPEAT('A', 16));
+insert into t2 values(1190, REPEAT('A', 16));
+insert into t2 values(1180, REPEAT('A', 16));
+
+--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 More insertions will cause page split.
+insert into t2 values(1280, REPEAT('A', 16));
+insert into t2 values(1290, REPEAT('A', 16));
+insert into t2 values(1281, REPEAT('A', 16));
+insert into t2 values(1291, REPEAT('A', 16));
+
+--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 much space are reserved on second index.
+}
+
+DROP TABLE t2; \ No newline at end of file
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_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_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..3cd02b23d8c 100644
--- a/mysql-test/suite/innodb/t/innodb_uninstall.test
+++ b/mysql-test/suite/innodb/t/innodb_uninstall.test
@@ -30,8 +30,6 @@ reap;
--source include/restart_mysqld.inc
-drop table t1;
-
#
# Another test that caused hang.
#
@@ -39,6 +37,8 @@ drop table t1;
connect (con1, localhost, root);
connection con1;
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_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/innodb-fts-fic.result b/mysql-test/suite/innodb_fts/r/innodb-fts-fic.result
index e5df6ca8b05..ee7277af640 100644
--- a/mysql-test/suite/innodb_fts/r/innodb-fts-fic.result
+++ b/mysql-test/suite/innodb_fts/r/innodb-fts-fic.result
@@ -36,6 +36,7 @@ count
2
ANALYZE TABLE articles;
Table Op Msg_type Msg_text
+test.articles analyze Warning Engine-independent statistics are not collected for column 'body'
test.articles analyze status OK
SELECT * FROM articles WHERE MATCH (title,body)
AGAINST ('+MySQL -YourSQL' IN BOOLEAN MODE);
diff --git a/mysql-test/suite/innodb_fts/r/innodb-fts-stopword.result b/mysql-test/suite/innodb_fts/r/innodb-fts-stopword.result
index ea0ec381faa..e0ba456b51c 100644
--- a/mysql-test/suite/innodb_fts/r/innodb-fts-stopword.result
+++ b/mysql-test/suite/innodb_fts/r/innodb-fts-stopword.result
@@ -247,6 +247,7 @@ articles CREATE TABLE `articles` (
ALTER TABLE articles ADD FULLTEXT INDEX idx (title,body);
ANALYZE TABLE articles;
Table Op Msg_type Msg_text
+test.articles analyze Warning Engine-independent statistics are not collected for column 'body'
test.articles analyze status OK
SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("where will");
id title body
@@ -569,6 +570,7 @@ select @@innodb_ft_enable_stopword;
1
ANALYZE TABLE articles;
Table Op Msg_type Msg_text
+test.articles analyze Warning Engine-independent statistics are not collected for column 'body'
test.articles analyze status OK
SELECT * FROM articles WHERE MATCH(title,body) AGAINST ("where will");
id title body
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_zip/r/innodb-zip.result b/mysql-test/suite/innodb_zip/r/innodb-zip.result
index dbfae3c0630..2113c6e1069 100644
--- a/mysql-test/suite/innodb_zip/r/innodb-zip.result
+++ b/mysql-test/suite/innodb_zip/r/innodb-zip.result
@@ -122,9 +122,11 @@ a left(b,40)
1 1abcdefghijklmnopqrstuvwxyzAAAAAAAAAAAAA
analyze table t1;
Table Op Msg_type Msg_text
+mysqltest_innodb_zip.t1 analyze Warning Engine-independent statistics are not collected for column 'b'
mysqltest_innodb_zip.t1 analyze status OK
analyze table t2;
Table Op Msg_type Msg_text
+mysqltest_innodb_zip.t2 analyze Warning Engine-independent statistics are not collected for column 'b'
mysqltest_innodb_zip.t2 analyze status OK
SELECT table_schema, table_name, row_format, data_length, index_length FROM information_schema.tables WHERE engine='innodb' AND table_schema != 'mysql';
table_schema table_name row_format data_length index_length
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 746072781bd..ccfd8a16710 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/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/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/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 85a21ada47d..42962b3a226 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/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..2f3b1934817 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
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..de6874d6423 100644
--- a/mysql-test/suite/multi_source/multisource.test
+++ b/mysql-test/suite/multi_source/multisource.test
@@ -5,6 +5,7 @@
--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)
@@ -99,11 +100,11 @@ select * from db1.t1;
# 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';
-
+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
@@ -221,6 +222,8 @@ flush logs;
--connection master1
purge binary logs to 'master-bin.000002';
+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;
@@ -252,10 +255,10 @@ 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';
+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
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..18e92c32e8e 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;
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..ebbc33e4c22 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*
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..c990a04acb0 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
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/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/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_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_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_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_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_repair_myisam.result b/mysql-test/suite/parts/r/partition_repair_myisam.result
index 3652698f634..cbc425b48db 100644
--- a/mysql-test/suite/parts/r/partition_repair_myisam.result
+++ b/mysql-test/suite/parts/r/partition_repair_myisam.result
@@ -322,6 +322,7 @@ FLUSH TABLES;
# replacing p6 with a crashed MYD file (1) (splitted dynamic record)
ANALYZE TABLE t1_will_crash;
Table Op Msg_type Msg_text
+test.t1_will_crash analyze Warning Engine-independent statistics are not collected for column 'c'
test.t1_will_crash analyze status OK
OPTIMIZE TABLE t1_will_crash;
Table Op Msg_type Msg_text
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_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_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_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/upgrade_check.inc b/mysql-test/suite/perfschema/include/upgrade_check.inc
index 52d4cfd1e63..327d63cc633 100644
--- a/mysql-test/suite/perfschema/include/upgrade_check.inc
+++ b/mysql-test/suite/perfschema/include/upgrade_check.inc
@@ -3,11 +3,10 @@
#
--source include/count_sessions.inc
---error 1
--exec $MYSQL_UPGRADE --skip-verbose --force > $out_file 2> $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
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/digest_table_full.result b/mysql-test/suite/perfschema/r/digest_table_full.result
index 64742d1dbe9..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 b12e7d0f2ac88c8fad9ac8dabb347b09 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/nesting.result b/mysql-test/suite/perfschema/r/nesting.result
index f1f872f95f9..2bf65c30e4a 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,118 @@ 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 76 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 64 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 stage/sql/checking permissions (stage) STATEMENT 60
+66 66 stage/sql/Opening tables (stage) STATEMENT 60
+67 67 stage/sql/After opening tables (stage) STATEMENT 60
+68 68 stage/sql/init (stage) STATEMENT 60
+69 69 stage/sql/optimizing (stage) STATEMENT 60
+70 70 stage/sql/executing (stage) STATEMENT 60
+71 71 stage/sql/end (stage) STATEMENT 60
+72 72 stage/sql/query end (stage) STATEMENT 60
+73 73 stage/sql/closing tables (stage) STATEMENT 60
+74 76 stage/sql/freeing items (stage) STATEMENT 60
+75 75 wait/io/socket/sql/client_connection send STAGE 74
+76 76 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 74
+77 91 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
+78 79 stage/sql/init (stage) STATEMENT 77
+79 79 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 78
+80 80 stage/sql/checking permissions (stage) STATEMENT 77
+81 81 stage/sql/Opening tables (stage) STATEMENT 77
+82 82 stage/sql/After opening tables (stage) STATEMENT 77
+83 83 stage/sql/init (stage) STATEMENT 77
+84 84 stage/sql/optimizing (stage) STATEMENT 77
+85 85 stage/sql/executing (stage) STATEMENT 77
+86 86 stage/sql/end (stage) STATEMENT 77
+87 87 stage/sql/query end (stage) STATEMENT 77
+88 88 stage/sql/closing tables (stage) STATEMENT 77
+89 91 stage/sql/freeing items (stage) STATEMENT 77
+90 90 wait/io/socket/sql/client_connection send STAGE 89
+91 91 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 89
+92 108 statement/sql/select select "With a third part to make things complete" as payload NULL NULL
+93 94 stage/sql/init (stage) STATEMENT 92
+94 94 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 93
+95 95 stage/sql/checking permissions (stage) STATEMENT 92
+96 96 stage/sql/Opening tables (stage) STATEMENT 92
+97 97 stage/sql/After opening tables (stage) STATEMENT 92
+98 98 stage/sql/init (stage) STATEMENT 92
+99 99 stage/sql/optimizing (stage) STATEMENT 92
+100 100 stage/sql/executing (stage) STATEMENT 92
+101 101 stage/sql/end (stage) STATEMENT 92
+102 102 stage/sql/query end (stage) STATEMENT 92
+103 103 stage/sql/closing tables (stage) STATEMENT 92
+104 104 stage/sql/freeing items (stage) STATEMENT 92
+105 105 wait/io/socket/sql/client_connection send STATEMENT 92
+106 106 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 92
+107 108 stage/sql/cleaning up (stage) STATEMENT 92
+108 108 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 107
+109 109 idle idle NULL NULL
+110 128 statement/sql/select select "MARKER_END" as marker NULL NULL
+111 114 stage/sql/init (stage) STATEMENT 110
+112 112 wait/io/socket/sql/client_connection recv STAGE 111
+113 113 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 111
+114 114 wait/io/file/sql/query_log write STAGE 111
+115 115 stage/sql/checking permissions (stage) STATEMENT 110
+116 116 stage/sql/Opening tables (stage) STATEMENT 110
+117 117 stage/sql/After opening tables (stage) STATEMENT 110
+118 118 stage/sql/init (stage) STATEMENT 110
+119 119 stage/sql/optimizing (stage) STATEMENT 110
+120 120 stage/sql/executing (stage) STATEMENT 110
+121 121 stage/sql/end (stage) STATEMENT 110
+122 122 stage/sql/query end (stage) STATEMENT 110
+123 123 stage/sql/closing tables (stage) STATEMENT 110
+124 124 stage/sql/freeing items (stage) STATEMENT 110
+125 125 wait/io/socket/sql/client_connection send STATEMENT 110
+126 126 wait/synch/mutex/sql/THD::LOCK_thd_data lock STATEMENT 110
+127 128 stage/sql/cleaning up (stage) STATEMENT 110
+128 128 wait/synch/mutex/sql/THD::LOCK_thd_data lock STAGE 127
diff --git a/mysql-test/suite/perfschema/r/pfs_upgrade_event.result b/mysql-test/suite/perfschema/r/pfs_upgrade_event.result
index cbd684a6232..6397ef7d90c 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_event.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_event.result
@@ -3,59 +3,6 @@ drop event if exists test.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..e03b526b045 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_func.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_func.result
@@ -3,59 +3,6 @@ drop function if exists test.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..95e0943d326 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_proc.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_proc.result
@@ -3,59 +3,6 @@ drop procedure if exists test.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..a5f5ad5ae17 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_table.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_table.result
@@ -5,59 +5,6 @@ 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..3c6df20a62c 100644
--- a/mysql-test/suite/perfschema/r/pfs_upgrade_view.result
+++ b/mysql-test/suite/perfschema/r/pfs_upgrade_view.result
@@ -5,59 +5,6 @@ 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/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/rpl_gtid_func.result b/mysql-test/suite/perfschema/r/rpl_gtid_func.result
index 389d21e179f..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
-1281ed1e23aaa2e5528e90ebf98cfbdd 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
-e0d84aed3bfac675887b38c4902f057f 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 aff444250e0..ba71e4ea6b0 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 e1c917a43f978456fab15240f89372ca 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
+statement/sql/truncate 9d8bb20bae9d3c7cdfd36bc9d78b1d63 TRUNCATE TABLE truncate table events_statements_history_long
+statement/sql/select d4c5d748dcc95f29805e3c04d47d7f64 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 a48006c8ba3..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 b12e7d0f2ac88c8fad9ac8dabb347b09 TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1 0 0 0
-statements_digest 390f3ff3444c4de44fcbd052b11caf4e SELECT ? FROM `t1` 2 0 0 0
-statements_digest 8726524372f6e4924bbe1393b772498e SELECT ?, ... FROM `t1` 2 0 0 0
-statements_digest 5b06fb13fa9af5e8a4ec26bac8f994cd SELECT ? FROM `t2` 1 0 0 0
-statements_digest 82201946968b4baca616292f96e933a7 SELECT ?, ... FROM `t2` 2 0 0 0
-statements_digest 35d365779571257e8837f01b39dd9df5 INSERT INTO `t1` VALUES (?) 2 2 0 0
-statements_digest eaaf6c26e98130ec21cfae1389e3eb94 INSERT INTO `t2` VALUES (?) 1 1 0 0
-statements_digest 28f3cfdcfffeff3219bdd255ed15e6ac INSERT INTO `t3` VALUES (...) 4 4 0 0
-statements_digest 166a9591b81371a6ea389f27cfc1e5fd INSERT INTO `t4` VALUES (...) 1 1 0 0
-statements_digest fb25b9f9146120fb72c3c732e79dcc82 INSERT INTO `t5` VALUES (...) 1 1 0 0
-statements_digest 58bb7798d974224ff08742502eed1aae INSERT INTO `t1` VALUES (?) /* , ... */ 2 7 0 0
-statements_digest 3352b44dcaf21f59141ea76b5cace5c0 INSERT INTO `t3` VALUES (...) /* , ... */ 1 3 0 0
-statements_digest 1905c012e5d6a3a12e39b0b3ce13b22a INSERT INTO `t5` VALUES (...) /* , ... */ 1 3 0 0
-statements_digest 981d682c1e63b437c33230eb558d0f64 INSERT INTO `t6` VALUES (...) 5 5 0 0
-statements_digest aeb185ab9b6e9d5a49e47c8741b8acdf SELECT ? + ? 3 0 0 0
-statements_digest d3804664eeee11407f3fcbd5c29a1f73 SELECT ? 1 0 0 0
-statements_digest 6382c1dfc79755af2dd46113acea142b CREATE SCHEMA `statements_digest_temp` 2 2 0 0
-statements_digest 256f8dfc97d90a79103ebd6616b8d7aa DROP SCHEMA `statements_digest_temp` 2 0 0 0
-statements_digest 5315d33e7ef87b104b73912d484af6a3 SELECT ? FROM `no_such_table` 1 0 0 1
-statements_digest dcde8f720a419aa5d52246207268cf6c CREATE TABLE `dup_table` ( `c` CHARACTER (?) ) 2 0 0 1
-statements_digest b4b4abab3f030642444fb32c44f28058 DROP TABLE `dup_table` 1 0 0 0
-statements_digest a34ed519fdeb4fe4460038db92ea0c20 INSERT INTO `t11` VALUES (?) 1 1 1 0
-statements_digest d3eda26b379bd56340ce84fe395dfff7 SHOW WARNINGS 1 0 0 0
-statements_digest e6aa634cf5a630087fefe9868b018329 PREPARE `stmt` FROM ? 1 0 0 0
-statements_digest 4de34527c0dfef6ad8387d4359f78c78 EXECUTE `stmt` 2 0 0 0
-statements_digest 54592849b6cf7386568c88e7fb20f61e DEALLOCATE PREPARE `stmt` 1 0 0 0
-statements_digest ee90db91a06cedfbcccf80f951dc58cd CREATE PROCEDURE `p1` ( ) BEGIN SELECT * FROM `t12` ; END 1 0 0 0
-statements_digest f964655a0037d2f194030bd024eab748 CALL `p1` ( ) 2 0 0 0
-statements_digest 788d8223f67ba10d1b97fcaa42fec081 DROP PROCEDURE `p1` 1 0 0 0
-statements_digest 5146273ef7d98ee1954d23fd98a35d68 CREATE FUNCTION `func` ( `a` INTEGER , `b` INTEGER ) RETURNS INTEGER (?) RETURN `a` + `b` 1 0 0 0
-statements_digest 2c9b8e1e7f2ad3ca3c49abb2ea30e871 SELECT `func` (...) 2 0 0 0
-statements_digest f48e30910f8e7758b818c088916424cd DROP FUNCTION `func` 1 0 0 0
-statements_digest 53ccf1d241eeb749f1e1b7becc65006f CREATE TRIGGER `trg` BEFORE INSERT ON `t12` FOR EACH ROW SET @? := ? 1 0 0 0
-statements_digest a9722a0717a57275431575c7204d71c1 INSERT INTO `t12` VALUES (?) 2 2 0 0
-statements_digest 2d48809e6899f63ec304776466a63eef 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 351bd41159c..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 b12e7d0f2ac88c8fad9ac8dabb347b09 TRUNCATE TABLE `performance_schema` . `events_statements_summary_by_digest` 1
-statements_digest 390f3ff3444c4de44fcbd052b11caf4e SELECT ? FROM `t1` 2
-statements_digest 8726524372f6e4924bbe1393b772498e SELECT ?, ... FROM `t1` 2
-statements_digest 5b06fb13fa9af5e8a4ec26bac8f994cd SELECT ? FROM `t2` 1
-statements_digest 82201946968b4baca616292f96e933a7 SELECT ?, ... FROM `t2` 2
-statements_digest 35d365779571257e8837f01b39dd9df5 INSERT INTO `t1` VALUES (?) 2
-statements_digest eaaf6c26e98130ec21cfae1389e3eb94 INSERT INTO `t2` VALUES (?) 1
-statements_digest 28f3cfdcfffeff3219bdd255ed15e6ac INSERT INTO `t3` VALUES (...) 4
-statements_digest 166a9591b81371a6ea389f27cfc1e5fd INSERT INTO `t4` VALUES (...) 1
-statements_digest fb25b9f9146120fb72c3c732e79dcc82 INSERT INTO `t5` VALUES (...) 1
-statements_digest 58bb7798d974224ff08742502eed1aae INSERT INTO `t1` VALUES (?) /* , ... */ 2
-statements_digest 3352b44dcaf21f59141ea76b5cace5c0 INSERT INTO `t3` VALUES (...) /* , ... */ 1
-statements_digest 1905c012e5d6a3a12e39b0b3ce13b22a INSERT INTO `t5` VALUES (...) /* , ... */ 1
-statements_digest 981d682c1e63b437c33230eb558d0f64 INSERT INTO `t6` VALUES (...) 5
-statements_digest aeb185ab9b6e9d5a49e47c8741b8acdf SELECT ? + ? 3
-statements_digest d3804664eeee11407f3fcbd5c29a1f73 SELECT ? 1
-statements_digest 6382c1dfc79755af2dd46113acea142b CREATE SCHEMA `statements_digest_temp` 2
-statements_digest 256f8dfc97d90a79103ebd6616b8d7aa DROP SCHEMA `statements_digest_temp` 2
-statements_digest 5315d33e7ef87b104b73912d484af6a3 SELECT ? FROM `no_such_table` 1
-statements_digest dcde8f720a419aa5d52246207268cf6c CREATE TABLE `dup_table` ( `c` CHARACTER (?) ) 2
-statements_digest b4b4abab3f030642444fb32c44f28058 DROP TABLE `dup_table` 1
-statements_digest a34ed519fdeb4fe4460038db92ea0c20 INSERT INTO `t11` VALUES (?) 1
-statements_digest d3eda26b379bd56340ce84fe395dfff7 SHOW WARNINGS 1
-statements_digest e6aa634cf5a630087fefe9868b018329 PREPARE `stmt` FROM ? 1
-statements_digest 4de34527c0dfef6ad8387d4359f78c78 EXECUTE `stmt` 2
-statements_digest 54592849b6cf7386568c88e7fb20f61e DEALLOCATE PREPARE `stmt` 1
-statements_digest ee90db91a06cedfbcccf80f951dc58cd CREATE PROCEDURE `p1` ( ) BEGIN SELECT * FROM `t12` ; END 1
-statements_digest f964655a0037d2f194030bd024eab748 CALL `p1` ( ) 2
-statements_digest 788d8223f67ba10d1b97fcaa42fec081 DROP PROCEDURE `p1` 1
-statements_digest 5146273ef7d98ee1954d23fd98a35d68 CREATE FUNCTION `func` ( `a` INTEGER , `b` INTEGER ) RETURNS INTEGER (?) RETURN `a` + `b` 1
-statements_digest 2c9b8e1e7f2ad3ca3c49abb2ea30e871 SELECT `func` (...) 2
-statements_digest f48e30910f8e7758b818c088916424cd DROP FUNCTION `func` 1
-statements_digest 53ccf1d241eeb749f1e1b7becc65006f CREATE TRIGGER `trg` BEFORE INSERT ON `t12` FOR EACH ROW SET @? := ? 1
-statements_digest a9722a0717a57275431575c7204d71c1 INSERT INTO `t12` VALUES (?) 2
-statements_digest 2d48809e6899f63ec304776466a63eef 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 dd0244475cc..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 b6650e3f746acc31ef465aede8087e93 TRUNCATE TABLE `events_statements_summary_by_digest` 1
-performance_schema 63f9aaeed7859671c6a42c75fcd43785 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/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/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/privilege.test b/mysql-test/suite/perfschema/t/privilege.test
index 926d90d6edc..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.*
@@ -333,4 +336,3 @@ UPDATE performance_schema.setup_consumers SET enabled = 'YES';
UPDATE performance_schema.setup_timers SET timer_name = 'MICROSECOND' where name="idle";
UPDATE performance_schema.setup_timers SET timer_name = 'NANOSECOND' where name="stage";
UPDATE performance_schema.setup_timers SET timer_name = 'NANOSECOND' where name="statement";
-
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 d06edb0d78f..bf04e62e1b5 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_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_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/cracklib_password_check.result b/mysql-test/suite/plugins/r/cracklib_password_check.result
new file mode 100644
index 00000000000..62f0e32b66a
--- /dev/null
+++ b/mysql-test/suite/plugins/r/cracklib_password_check.result
@@ -0,0 +1,44 @@
+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.11
+PLUGIN_AUTHOR Sergei Golubchik
+PLUGIN_DESCRIPTION Password validation via CrackLib
+PLUGIN_LICENSE GPL
+LOAD_OPTION ON
+PLUGIN_MATURITY Alpha
+PLUGIN_AUTH_VERSION 1.0
+grant select on *.* to foobar identified by 'foobar';
+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 foobar identified by 'raboof';
+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;
+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/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..623e8e9314b 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.11 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.11 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..c74b4e99992
--- /dev/null
+++ b/mysql-test/suite/plugins/r/simple_password_check.result
@@ -0,0 +1,152 @@
+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.11
+PLUGIN_AUTHOR Sergei Golubchik
+PLUGIN_DESCRIPTION Simple password strength checks
+PLUGIN_LICENSE GPL
+LOAD_OPTION ON
+PLUGIN_MATURITY Alpha
+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
+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;
+set global simple_password_check_other_characters=3;
+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;
+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/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_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/cracklib_password_check.test b/mysql-test/suite/plugins/t/cracklib_password_check.test
new file mode 100644
index 00000000000..a8f404009d0
--- /dev/null
+++ b/mysql-test/suite/plugins/t/cracklib_password_check.test
@@ -0,0 +1,37 @@
+--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 foobar identified by 'foobar';
+show warnings;
+
+--error ER_NOT_VALID_PASSWORD
+grant select on *.* to foobar identified by 'raboof';
+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;
+
+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/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..9854f93efe8
--- /dev/null
+++ b/mysql-test/suite/plugins/t/simple_password_check.test
@@ -0,0 +1,110 @@
+--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';
+
+--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;
+
+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/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 0010853be78..7ced6255629 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) ;;
diff --git a/mysql-test/suite/roles/definer.test b/mysql-test/suite/roles/definer.test
index 3c069105c8c..3de4a6922c2 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/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..3ce6d5c054b 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;
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 839032a305c..c5dd67ed65c 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 6e29d02e3bc..4a89a45354d 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 8550976e87a..663557cc1f3 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/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 6234e953cdd..9fcfa35204b 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("MSYQL_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 d88258f3b65..b8c718ff821 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
@@ -143,6 +143,7 @@ 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 occured on the master. Message: error writing to the binary log'
+FOUND /Slave SQL: The incident LOST_EVENTS occured 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
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_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_errorlog.result b/mysql-test/suite/rpl/r/rpl_gtid_errorlog.result
index 204615201d9..ab615d0510a 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_errorlog.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_errorlog.result
@@ -38,5 +38,7 @@ a
3
4
5
+FOUND /Slave SQL: Error 'Duplicate entry .* on query\. .*Query: '.*', Gtid 0-1-100, Internal MariaDB error code:|Slave SQL: Could not execute Write_rows.*table test.t1; Duplicate entry.*, Gtid 0-1-100, Internal MariaDB error/ in mysqld.2.err
+FOUND /Slave SQL: The incident LOST_EVENTS occured on the master\. Message: <none>, Internal MariaDB error code: 1590/ in mysqld.2.err
DROP TABLE t1;
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 8e7166fa278..aa5f6d3e6db 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..fc8a5edc997
--- /dev/null
+++ b/mysql-test/suite/rpl/r/rpl_parallel_optimistic.result
@@ -0,0 +1,504 @@
+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
+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 9c04f580c07..283e769ce9a 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_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_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..7f37805b635 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;
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_sp.result b/mysql-test/suite/rpl/r/rpl_sp.result
index 8ca72672073..ea9c8906217 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_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_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_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_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/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 9e4a106a5b5..72de3a1ef37 100644
--- a/mysql-test/suite/rpl/t/rpl_binlog_errors.test
+++ b/mysql-test/suite/rpl/t/rpl_binlog_errors.test
@@ -75,7 +75,7 @@ FLUSH LOGS;
-- source include/show_binary_logs.inc
### ACTION: clean up and move to next test
-SET GLOBAL debug_dbug="";
+SET GLOBAL debug_dbug=@old_debug;
RESET MASTER;
-- echo ###################### TEST #3
@@ -100,7 +100,7 @@ RESET MASTER;
-- 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";
+SET GLOBAL debug_dbug=@old_debug;
DELETE FROM t2;
RESET MASTER;
@@ -121,7 +121,7 @@ SET GLOBAL debug_dbug="+d,error_unique_log_filename";
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";
+SET GLOBAL debug_dbug=@old_debug;
DELETE FROM t2;
RESET MASTER;
@@ -139,7 +139,7 @@ SET GLOBAL debug_dbug="+d,error_unique_log_filename";
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";
+SET GLOBAL debug_dbug=@old_debug;
DELETE FROM t2;
RESET MASTER;
@@ -165,7 +165,7 @@ 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";
+SET GLOBAL debug_dbug=@old_debug;
DELETE FROM t2;
RESET MASTER;
@@ -185,7 +185,7 @@ SELECT count(*) FROM t4;
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";
+SET GLOBAL debug_dbug=@old_debug;
-- let $binlog_limit= 4,1
-- source include/show_binlog_events.inc
@@ -229,7 +229,7 @@ SELECT count(*) FROM t4;
SELECT count(*) FROM t2;
# remove fault injection
-SET GLOBAL debug_dbug="-d,error_unique_log_filename";
+SET GLOBAL debug_dbug=@old_debug;
-- echo ###################### TEST #9
@@ -248,7 +248,7 @@ DELETE FROM t4;
SELECT count(*) FROM t2;
SELECT count(*) FROM t4;
SET SQL_LOG_BIN=1;
-SET GLOBAL debug_dbug="-d,error_unique_log_filename";
+SET GLOBAL debug_dbug=@old_debug;
-- echo ###################### TEST #10
@@ -340,7 +340,6 @@ DROP TABLE t5;
--source include/rpl_restart_server.inc
## clean up
-SET GLOBAL debug_dbug= @old_debug;
DROP TABLE t1, t2, t4;
RESET MASTER;
@@ -398,7 +397,6 @@ call mtr.add_suppression("Can't generate a unique log-filename .*");
### clean up
-- source include/stop_slave_sql.inc
-SET GLOBAL debug_dbug=@old_debug;
RESET SLAVE;
RESET MASTER;
--let $rpl_only_running_threads= 1
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_checksum.test b/mysql-test/suite/rpl/t/rpl_checksum.test
index bd0ab7ecc9c..ff7d2801911 100644
--- a/mysql-test/suite/rpl/t/rpl_checksum.test
+++ b/mysql-test/suite/rpl/t/rpl_checksum.test
@@ -95,6 +95,7 @@ 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
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_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..772194e55f4 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_basic.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_basic.test
@@ -232,6 +232,10 @@ eval SET @pos= '$pos';
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;
@@ -276,7 +280,7 @@ SELECT master_gtid_wait('1-1-1', 0);
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.
+# 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,)
@@ -306,14 +310,35 @@ 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;
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 b0019b70dc8..f9b01c83917 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_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_loadfile.test b/mysql-test/suite/rpl/t/rpl_loadfile.test
index 3f897faac48..30a7ae2f613 100644
--- a/mysql-test/suite/rpl/t/rpl_loadfile.test
+++ b/mysql-test/suite/rpl/t/rpl_loadfile.test
@@ -6,7 +6,6 @@
#############################################################################
# Change Author: JBM
# Change Date: 2006-01-16
-# Change: Added Order by for NDB
##########
# Includes
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_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_parallel.test b/mysql-test/suite/rpl/t/rpl_parallel.test
index ace9e8e37f4..a7e5353a9fc 100644
--- a/mysql-test/suite/rpl/t/rpl_parallel.test
+++ b/mysql-test/suite/rpl/t/rpl_parallel.test
@@ -1,8 +1,7 @@
--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
+--source include/master-slave.inc
# Test various aspects of parallel replication.
@@ -1860,7 +1859,6 @@ 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
@@ -1916,6 +1914,68 @@ 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 ***
@@ -2383,19 +2443,19 @@ SET GLOBAL debug_dbug=@old_dbug;
# mark_start_commit() being already called.
--disable_warnings
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;
--enable_warnings
-SELECT * FROM t1 WHERE a>=200 ORDER BY a;
-SELECT * FROM t2 WHERE a>=200 ORDER BY a;
+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>=200 ORDER BY a;
-SELECT * FROM t2 WHERE a>=200 ORDER BY a;
+SELECT * FROM t1 WHERE a>=2000 ORDER BY a;
+SELECT * FROM t2 WHERE a>=2000 ORDER BY a;
# Clean up.
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..93dfe4d5e7c
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_parallel_optimistic.test
@@ -0,0 +1,470 @@
+--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;
+
+
+# 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_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..4c0840446ec 100644
--- a/mysql-test/suite/rpl/t/rpl_relayrotate.test
+++ b/mysql-test/suite/rpl/t/rpl_relayrotate.test
@@ -1,10 +1,7 @@
#######################################################
# 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
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_mysqlbinlog.test b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
index ed0f31b75be..a44cc18c0ed 100644
--- a/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
+++ b/mysql-test/suite/rpl/t/rpl_row_mysqlbinlog.test
@@ -21,6 +21,7 @@
--disable_query_log
select "---Setup Section --" as "";
+set sql_mode="";
--enable_query_log
set timestamp=1000000000;
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..e3c90d874f0 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;
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..a9ea4985039 100644
--- a/mysql-test/suite/rpl/t/rpl_semi_sync.test
+++ b/mysql-test/suite/rpl/t/rpl_semi_sync.test
@@ -59,7 +59,6 @@ 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 #
@@ -120,7 +119,6 @@ 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;
@@ -129,7 +127,6 @@ 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
@@ -153,7 +150,6 @@ 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;
@@ -302,14 +298,12 @@ source include/stop_slave.inc;
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;
@@ -358,7 +352,6 @@ 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;
@@ -410,7 +403,6 @@ 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 #
@@ -460,7 +452,6 @@ 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);
@@ -468,7 +459,6 @@ 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 #
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 142cd53b9dd..4348675884b 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_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_ssl.test b/mysql-test/suite/rpl/t/rpl_ssl.test
index 43289428d45..9e42764715b 100644
--- a/mysql-test/suite/rpl/t/rpl_ssl.test
+++ b/mysql-test/suite/rpl/t/rpl_ssl.test
@@ -3,6 +3,7 @@ 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));
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 5d2c85b2cb6..e82c951ce0c 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_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_switch_stm_row_mixed.test b/mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test
index 4ba66b5fbf8..575fdb2e89d 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
@@ -9,7 +9,6 @@
# - correctness of execution
--- source include/not_ndb_default.inc
-- source include/have_binlog_format_mixed_or_row.inc
-- source include/master-slave.inc
@@ -150,7 +149,9 @@ insert into t1 select "yesterday_24_";
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
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 70a2063c23c..57954698a2c 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..af4ce104af4
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_temporal_format_default_to_default.test
@@ -0,0 +1,76 @@
+--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/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_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_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 6c2f5a4d50f..e1ae2f1fa64 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 93bb4c617e5..1c9fee3ceac 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..a009bc5c174 100644
--- a/mysql-test/suite/sys_vars/disabled.def
+++ b/mysql-test/suite/sys_vars/disabled.def
@@ -12,3 +12,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/explicit_defaults_for_timestamp.inc b/mysql-test/suite/sys_vars/inc/explicit_defaults_for_timestamp.inc
new file mode 100644
index 00000000000..4cf3914e60a
--- /dev/null
+++ b/mysql-test/suite/sys_vars/inc/explicit_defaults_for_timestamp.inc
@@ -0,0 +1,99 @@
+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;
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/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/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..cdf612e6db8
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_off.result
@@ -0,0 +1,175 @@
+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;
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..1c42da57bfc
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/explicit_defaults_for_timestamp_on.result
@@ -0,0 +1,180 @@
+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;
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 f95553e3fa2..0730055d104 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
-backoff
+BACKOFF
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_log_compressed_pages_basic.result b/mysql-test/suite/sys_vars/r/innodb_log_compressed_pages_basic.result
index 8cb8d900b59..3b1ad38fd31 100644
--- a/mysql-test/suite/sys_vars/r/innodb_log_compressed_pages_basic.result
+++ b/mysql-test/suite/sys_vars/r/innodb_log_compressed_pages_basic.result
@@ -1,7 +1,7 @@
SET @start_global_value = @@global.innodb_log_compressed_pages;
SELECT @start_global_value;
@start_global_value
-1
+0
'#---------------------BS_STVARS_028_01----------------------#'
SELECT COUNT(@@GLOBAL.innodb_log_compressed_pages);
COUNT(@@GLOBAL.innodb_log_compressed_pages)
@@ -66,4 +66,4 @@ ERROR 42S22: Unknown column 'innodb_log_compressed_pages' in 'field list'
SET @@global.innodb_log_compressed_pages = @start_global_value;
SELECT @@global.innodb_log_compressed_pages;
@@global.innodb_log_compressed_pages
-1
+0
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..6c7051dc3d0 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,11 @@ 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_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 +72,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 +167,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 +215,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..6c7051dc3d0 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,11 @@ 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_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 +72,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 +167,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 +215,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..6c7051dc3d0 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,11 @@ 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_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 +72,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 +167,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 +215,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..6c7051dc3d0 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,11 @@ 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_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 +72,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 +167,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 +215,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_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_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..3160fd7c4fb 100644
--- a/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
+++ b/mysql-test/suite/sys_vars/r/optimizer_switch_basic.result
@@ -53,6 +53,8 @@ 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
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
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..2948b2ad3fc
--- /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 NULL
+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 NULL
+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 NULL
+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..799ad90a474
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_debug,32bit.rdiff
@@ -0,0 +1,24 @@
+--- 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
+@@ -35,10 +35,10 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 0
+ VARIABLE_SCOPE GLOBAL
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Call my_debug_put_break_here() if crc matches this number (for debug)
+ NUMERIC_MIN_VALUE 0
+-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_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..4ac8b9fb53b
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit,xtradb.rdiff
@@ -0,0 +1,1249 @@
+--- suite/sys_vars/r/sysvars_innodb.result
++++ suite/sys_vars/r/sysvars_innodb,32bit,xtradb.reject
+@@ -47,13 +47,27 @@
+ ENUM_VALUE_LIST NULL
+ 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 NULL
+ 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 Depricated. This option is temporary alias of --innodb-numa-interleave.
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST NULL
++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 NULL
++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
+@@ -753,7 +893,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
+@@ -761,6 +901,20 @@
+ ENUM_VALUE_LIST NULL
+ READ_ONLY YES
+ COMMAND_LINE_ARGUMENT OPTIONAL
++VARIABLE_NAME INNODB_EMPTY_FREE_LIST_ALGORITHM
++SESSION_VALUE NULL
++GLOBAL_VALUE BACKOFF
++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
+@@ -831,13 +985,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 NULL
++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
+@@ -851,7 +1019,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
+@@ -921,7 +1089,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
+@@ -935,7 +1103,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
+@@ -958,12 +1126,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
+@@ -991,7 +1159,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
+@@ -1033,7 +1201,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
+@@ -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 Kills the server during crash recovery.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 10
+@@ -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 NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT NONE
+ VARIABLE_NAME INNODB_LOCKS_UNSAFE_FOR_BINLOG
+ SESSION_VALUE NULL
+ GLOBAL_VALUE OFF
+@@ -1341,7 +1551,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
+@@ -1349,35 +1559,105 @@
+ 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 NULL
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT OPTIONAL
+-VARIABLE_NAME INNODB_LOG_COMPRESSED_PAGES
++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 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 NULL
++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 OFF
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+@@ -1397,7 +1677,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
+@@ -1439,9 +1719,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
+@@ -1481,10 +1789,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
+@@ -1495,7 +1803,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
+@@ -1509,7 +1817,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
+@@ -1579,7 +1887,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
+@@ -1635,10 +1943,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
+@@ -1663,7 +1971,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
+@@ -1677,7 +1985,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
+@@ -1713,13 +2021,69 @@
+ ENUM_VALUE_LIST NULL
+ 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 NULL
++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 NULL
++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 NULL
++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 NULL
++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
+@@ -1761,7 +2125,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
+@@ -1789,7 +2153,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
+@@ -1803,7 +2167,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
+@@ -1831,10 +2195,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
+@@ -1859,7 +2223,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
+@@ -1873,7 +2237,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
+@@ -1881,6 +2245,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
+@@ -1909,6 +2315,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
+@@ -1929,7 +2363,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
+@@ -1943,10 +2377,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
+@@ -1972,7 +2406,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
+@@ -2139,7 +2573,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
+@@ -2153,10 +2587,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
+@@ -2181,7 +2615,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
+@@ -2195,7 +2629,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
+@@ -2203,6 +2637,34 @@
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT REQUIRED
++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 NULL
++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 NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT OPTIONAL
+ VARIABLE_NAME INNODB_TRX_PURGE_VIEW_UPDATE_ONLY_DEBUG
+ SESSION_VALUE NULL
+ GLOBAL_VALUE OFF
+@@ -2251,7 +2713,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
+@@ -2265,7 +2727,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
+@@ -2280,7 +2742,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
+@@ -2301,6 +2763,20 @@
+ ENUM_VALUE_LIST NULL
+ 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 NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT NONE
+ VARIABLE_NAME INNODB_USE_MTFLUSH
+ SESSION_VALUE NULL
+ GLOBAL_VALUE OFF
+@@ -2315,6 +2791,20 @@
+ ENUM_VALUE_LIST NULL
+ 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 NULL
++READ_ONLY YES
++COMMAND_LINE_ARGUMENT NONE
+ VARIABLE_NAME INNODB_USE_SYS_MALLOC
+ SESSION_VALUE NULL
+ GLOBAL_VALUE ON
+@@ -2345,12 +2835,12 @@
+ COMMAND_LINE_ARGUMENT OPTIONAL
+ VARIABLE_NAME INNODB_VERSION
+ SESSION_VALUE NULL
+-GLOBAL_VALUE 5.6.27
++GLOBAL_VALUE 5.6.26-76.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
+@@ -2363,7 +2853,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..e1db778832f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,32bit.rdiff
@@ -0,0 +1,580 @@
+--- 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
+@@ -753,7 +753,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
+@@ -837,7 +837,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
+@@ -851,7 +851,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
+@@ -921,7 +921,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
+@@ -935,7 +935,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
+@@ -963,7 +963,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
+@@ -991,7 +991,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
+@@ -1033,7 +1033,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
+@@ -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 Kills the server during crash recovery.
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 10
+@@ -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
+@@ -1341,7 +1341,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
+@@ -1355,10 +1355,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
+@@ -1397,7 +1397,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
+@@ -1439,10 +1439,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
+@@ -1481,10 +1481,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
+@@ -1495,7 +1495,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
+@@ -1509,7 +1509,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
+@@ -1579,7 +1579,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
+@@ -1635,10 +1635,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
+@@ -1663,7 +1663,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
+@@ -1677,7 +1677,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
+@@ -1719,7 +1719,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
+@@ -1761,7 +1761,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
+@@ -1789,7 +1789,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
+@@ -1803,7 +1803,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
+@@ -1831,10 +1831,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
+@@ -1859,7 +1859,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
+@@ -1873,7 +1873,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
+@@ -1929,7 +1929,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
+@@ -1943,10 +1943,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
+@@ -2139,7 +2139,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
+@@ -2153,10 +2153,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
+@@ -2181,7 +2181,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
+@@ -2195,7 +2195,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
+@@ -2251,7 +2251,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
+@@ -2265,7 +2265,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
+@@ -2363,7 +2363,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..a9e975313db
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb,xtradb.rdiff
@@ -0,0 +1,675 @@
+--- suite/sys_vars/r/sysvars_innodb.result
++++ suite/sys_vars/r/sysvars_innodb,xtradb.reject
+@@ -47,6 +47,20 @@
+ ENUM_VALUE_LIST NULL
+ 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 NULL
+ 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 Depricated. This option is temporary alias of --innodb-numa-interleave.
++NUMERIC_MIN_VALUE NULL
++NUMERIC_MAX_VALUE NULL
++NUMERIC_BLOCK_SIZE NULL
++ENUM_VALUE_LIST NULL
++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 NULL
++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
+@@ -761,6 +901,20 @@
+ ENUM_VALUE_LIST NULL
+ READ_ONLY YES
+ COMMAND_LINE_ARGUMENT OPTIONAL
++VARIABLE_NAME INNODB_EMPTY_FREE_LIST_ALGORITHM
++SESSION_VALUE NULL
++GLOBAL_VALUE BACKOFF
++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
+@@ -831,6 +985,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 NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT OPTIONAL
+ VARIABLE_NAME INNODB_FAST_SHUTDOWN
+ SESSION_VALUE NULL
+ GLOBAL_VALUE 1
+@@ -958,11 +1126,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 NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT NONE
+ VARIABLE_NAME INNODB_LOCKS_UNSAFE_FOR_BINLOG
+ SESSION_VALUE NULL
+ GLOBAL_VALUE OFF
+@@ -1349,6 +1559,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 NULL
++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
+@@ -1377,6 +1643,20 @@
+ ENUM_VALUE_LIST NULL
+ 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 OFF
+@@ -1447,6 +1727,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
+@@ -1713,6 +2021,62 @@
+ ENUM_VALUE_LIST NULL
+ 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 NULL
++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 NULL
++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 NULL
++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 NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT OPTIONAL
+ VARIABLE_NAME INNODB_PURGE_BATCH_SIZE
+ SESSION_VALUE NULL
+ GLOBAL_VALUE 300
+@@ -1881,6 +2245,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
+@@ -1909,6 +2315,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
+@@ -1972,7 +2406,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
+@@ -2203,14 +2637,28 @@
+ ENUM_VALUE_LIST NULL
+ READ_ONLY NO
+ COMMAND_LINE_ARGUMENT REQUIRED
+-VARIABLE_NAME INNODB_TMPDIR
+-SESSION_VALUE
+-GLOBAL_VALUE
++VARIABLE_NAME INNODB_TRACK_CHANGED_PAGES
++SESSION_VALUE NULL
++GLOBAL_VALUE OFF
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+-DEFAULT_VALUE
+-VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE VARCHAR
+-VARIABLE_COMMENT Directory for temporary non-tablespace files.
++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 NULL
++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
+@@ -2294,7 +2742,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
+@@ -2315,6 +2763,20 @@
+ ENUM_VALUE_LIST NULL
+ 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 NULL
++READ_ONLY NO
++COMMAND_LINE_ARGUMENT NONE
+ VARIABLE_NAME INNODB_USE_MTFLUSH
+ SESSION_VALUE NULL
+ GLOBAL_VALUE OFF
+@@ -2329,6 +2791,20 @@
+ ENUM_VALUE_LIST NULL
+ 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 NULL
++READ_ONLY YES
++COMMAND_LINE_ARGUMENT NONE
+ VARIABLE_NAME INNODB_USE_SYS_MALLOC
+ SESSION_VALUE NULL
+ GLOBAL_VALUE ON
+@@ -2359,12 +2835,12 @@
+ COMMAND_LINE_ARGUMENT OPTIONAL
+ VARIABLE_NAME INNODB_VERSION
+ SESSION_VALUE NULL
+-GLOBAL_VALUE 5.6.29
++GLOBAL_VALUE 5.6.28-76.1
+ 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..0ddc401e618
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result
@@ -0,0 +1,2387 @@
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 none
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE none
+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_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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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_FORCE_RECOVERY_CRASH
+SESSION_VALUE NULL
+GLOBAL_VALUE 0
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 0
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Kills the server during crash recovery.
+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_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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+READ_ONLY YES
+COMMAND_LINE_ARGUMENT NONE
+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 NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_LOG_COMPRESSED_PAGES
+SESSION_VALUE NULL
+GLOBAL_VALUE OFF
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+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 NULL
+READ_ONLY NO
+COMMAND_LINE_ARGUMENT OPTIONAL
+VARIABLE_NAME INNODB_VERSION
+SESSION_VALUE NULL
+GLOBAL_VALUE 5.6.29
+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..170989d9fa0
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded,32bit.rdiff
@@ -0,0 +1,1244 @@
+--- suite/sys_vars/r/sysvars_server_embedded.result 2015-09-04 13:17:44.407031503 +0000
++++ suite/sys_vars/r/sysvars_server_embedded,32bit.reject 2015-09-04 13:39:45.098389360 +0000
+@@ -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 MySQL 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
+@@ -813,7 +813,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
+@@ -855,7 +855,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
+@@ -897,7 +897,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
+@@ -911,7 +911,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
+@@ -925,7 +925,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
+@@ -984,7 +984,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
+@@ -1135,7 +1135,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
+@@ -1163,7 +1163,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
+@@ -1275,7 +1275,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
+@@ -1306,7 +1306,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
+@@ -1331,7 +1331,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
+@@ -1362,7 +1362,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
+@@ -1569,7 +1569,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
+@@ -1667,7 +1667,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
+@@ -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 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
+@@ -1737,7 +1737,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
+@@ -1747,14 +1747,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
+@@ -1765,7 +1765,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
+@@ -1775,14 +1775,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
+@@ -1793,7 +1793,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
+@@ -1807,7 +1807,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
+@@ -1821,7 +1821,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
+@@ -1849,7 +1849,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
+@@ -1866,7 +1866,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
+@@ -1877,7 +1877,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
+@@ -1905,7 +1905,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
+@@ -1919,7 +1919,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
+@@ -1933,7 +1933,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
+@@ -1947,7 +1947,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
+@@ -1961,7 +1961,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
+@@ -1975,7 +1975,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
+@@ -2003,7 +2003,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
+@@ -2031,7 +2031,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
+@@ -2045,7 +2045,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
+@@ -2059,7 +2059,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
+@@ -2073,7 +2073,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
+@@ -2087,7 +2087,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
+@@ -2101,10 +2101,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
+@@ -2115,7 +2115,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
+@@ -2129,7 +2129,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
+@@ -2139,9 +2139,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
+@@ -2153,14 +2153,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
+@@ -2185,10 +2185,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
+@@ -2202,7 +2202,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
+@@ -2255,7 +2255,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
+@@ -2269,7 +2269,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
+@@ -2283,7 +2283,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
+@@ -2297,7 +2297,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
+@@ -2367,7 +2367,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
+@@ -2381,7 +2381,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
+@@ -2395,7 +2395,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
+@@ -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 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
+@@ -2451,7 +2451,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
+@@ -2465,7 +2465,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
+@@ -2479,7 +2479,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
+@@ -2493,7 +2493,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
+@@ -2507,7 +2507,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
+@@ -2521,7 +2521,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
+@@ -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_WAITS_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_WAITS_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 Maximum number of instrumented hosts. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2577,7 +2577,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
+@@ -2591,7 +2591,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
+@@ -2605,7 +2605,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
+@@ -2619,7 +2619,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
+@@ -2633,7 +2633,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
+@@ -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 files. 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 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
+@@ -2675,7 +2675,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
+@@ -2689,7 +2689,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
+@@ -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 RWLOCK objects. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 104857600
+@@ -2717,7 +2717,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
+@@ -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 opened instrumented sockets. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2745,7 +2745,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
+@@ -2759,7 +2759,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
+@@ -2773,7 +2773,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
+@@ -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 instrumented tables. 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 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
+@@ -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 threads. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2829,7 +2829,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
+@@ -2843,7 +2843,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
+@@ -2857,7 +2857,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
+@@ -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 users. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2941,7 +2941,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
+@@ -2969,7 +2969,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 15
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Limit of query profiling memory
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 100
+@@ -2983,7 +2983,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
+@@ -3039,10 +3039,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
+@@ -3053,7 +3053,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
+@@ -3067,7 +3067,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
+@@ -3081,7 +3081,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
+@@ -3098,7 +3098,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
+@@ -3151,7 +3151,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
+@@ -3165,7 +3165,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
+@@ -3179,7 +3179,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
+@@ -3207,7 +3207,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
+@@ -3221,10 +3221,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
+@@ -3263,7 +3263,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
+@@ -3361,7 +3361,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
+@@ -3375,7 +3375,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
+@@ -3434,7 +3434,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
+@@ -3711,7 +3711,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
+@@ -3781,7 +3781,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
+@@ -3795,7 +3795,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 524288
+@@ -3809,7 +3809,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
+@@ -3823,7 +3823,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
+@@ -3938,7 +3938,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MySQL 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
+@@ -3949,7 +3949,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
+@@ -3963,7 +3963,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
+@@ -4061,7 +4061,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
+@@ -4165,7 +4165,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
+@@ -4178,7 +4178,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
+@@ -4188,7 +4188,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
+@@ -4273,7 +4273,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..fd003588668
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_embedded.result
@@ -0,0 +1,4295 @@
+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 autocommit
+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 MySQL 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 Allow big result sets by saving all temporary sets on file (Solves most 'table full' errors)
+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 NULL
+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 Type of DELAY_KEY_WRITE
+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 foreign_key_checks
+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 have_compress
+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 have_crypt
+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 have_dynamic_loading
+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 have_geometry
+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 have_profiling
+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 have_query_cache
+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 have_rtree_keys
+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 have_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 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_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_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_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 SELECT query that have 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 NULL
+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
+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
+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
+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,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 profiling
+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 Limit of query profiling memory
+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 MySQL 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 skip_replication
+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 sql_auto_is_null
+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 sql_big_selects
+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 sql_buffer_result
+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 Controls whether logging to the binary log is done
+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 sql_log_off
+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 sql_notes
+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 sql_quote_show_create
+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 sql_safe_updates
+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 sql_warnings
+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 524288
+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 time_zone
+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, MySQL 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 Set default transaction access mode to read only.
+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 unique_checks
+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 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 HAVE_SYMLINK
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT have_symlink
+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
+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 version_comment
+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 version_compile_machine
+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 version_compile_os
+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..e87f2647f69
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded,32bit.rdiff
@@ -0,0 +1,1280 @@
+--- suite/sys_vars/r/sysvars_server_notembedded.result
++++ suite/sys_vars/r/sysvars_server_notembedded,32bit.reject
+@@ -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 MySQL 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
+@@ -841,7 +841,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
+@@ -883,7 +883,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
+@@ -925,7 +925,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
+@@ -939,7 +939,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
+@@ -953,7 +953,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
+@@ -1012,7 +1012,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
+@@ -1247,7 +1247,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
+@@ -1275,7 +1275,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
+@@ -1387,7 +1387,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
+@@ -1418,7 +1418,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
+@@ -1443,7 +1443,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
+@@ -1474,7 +1474,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
+@@ -1695,7 +1695,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
+@@ -1835,7 +1835,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
+@@ -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 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
+@@ -1919,7 +1919,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
+@@ -1929,14 +1929,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
+@@ -1947,7 +1947,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
+@@ -1957,14 +1957,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
+@@ -1975,7 +1975,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
+@@ -1989,7 +1989,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
+@@ -2003,7 +2003,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
+@@ -2031,7 +2031,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
+@@ -2048,7 +2048,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
+@@ -2059,7 +2059,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
+@@ -2087,7 +2087,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
+@@ -2101,7 +2101,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
+@@ -2115,7 +2115,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
+@@ -2143,7 +2143,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
+@@ -2157,7 +2157,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
+@@ -2171,7 +2171,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
+@@ -2199,7 +2199,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
+@@ -2227,7 +2227,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
+@@ -2241,7 +2241,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
+@@ -2255,7 +2255,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
+@@ -2269,7 +2269,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
+@@ -2283,7 +2283,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
+@@ -2297,10 +2297,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
+@@ -2311,7 +2311,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
+@@ -2325,7 +2325,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
+@@ -2335,9 +2335,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
+@@ -2349,14 +2349,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
+@@ -2381,10 +2381,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
+@@ -2398,7 +2398,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
+@@ -2451,7 +2451,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
+@@ -2465,7 +2465,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
+@@ -2479,7 +2479,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
+@@ -2493,7 +2493,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
+@@ -2563,7 +2563,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
+@@ -2577,7 +2577,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
+@@ -2591,7 +2591,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
+@@ -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 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
+@@ -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 user@host accounts. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2661,7 +2661,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
+@@ -2675,7 +2675,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
+@@ -2689,7 +2689,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
+@@ -2703,7 +2703,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
+@@ -2717,7 +2717,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
+@@ -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_WAITS_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_WAITS_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 Maximum number of instrumented hosts. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2773,7 +2773,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
+@@ -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 instrumented condition objects. 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 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
+@@ -2801,7 +2801,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
+@@ -2815,7 +2815,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
+@@ -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 instrumented files. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2843,7 +2843,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
+@@ -2857,7 +2857,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
+@@ -2871,7 +2871,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
+@@ -2885,7 +2885,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
+@@ -2899,7 +2899,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
+@@ -2913,7 +2913,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
+@@ -2927,7 +2927,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
+@@ -2941,7 +2941,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
+@@ -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 opened instrumented tables. Use 0 to disable, -1 for automated sizing.
+ NUMERIC_MIN_VALUE -1
+ NUMERIC_MAX_VALUE 1048576
+@@ -2969,7 +2969,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
+@@ -2983,7 +2983,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
+@@ -2997,7 +2997,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
+@@ -3011,7 +3011,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
+@@ -3025,7 +3025,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
+@@ -3039,7 +3039,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
+@@ -3053,7 +3053,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
+@@ -3123,7 +3123,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
+@@ -3151,7 +3151,7 @@
+ GLOBAL_VALUE_ORIGIN COMPILE-TIME
+ DEFAULT_VALUE 15
+ VARIABLE_SCOPE SESSION
+-VARIABLE_TYPE BIGINT UNSIGNED
++VARIABLE_TYPE INT UNSIGNED
+ VARIABLE_COMMENT Limit of query profiling memory
+ NUMERIC_MIN_VALUE 0
+ NUMERIC_MAX_VALUE 100
+@@ -3165,7 +3165,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
+@@ -3221,10 +3221,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
+@@ -3235,7 +3235,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
+@@ -3249,7 +3249,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
+@@ -3263,7 +3263,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
+@@ -3280,7 +3280,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
+@@ -3333,7 +3333,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
+@@ -3347,7 +3347,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
+@@ -3361,7 +3361,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
+@@ -3389,7 +3389,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
+@@ -3669,10 +3669,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
+@@ -3711,7 +3711,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
+@@ -3837,7 +3837,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
+@@ -3879,7 +3879,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
+@@ -3907,7 +3907,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
+@@ -3935,7 +3935,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
+@@ -3991,7 +3991,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
+@@ -4019,7 +4019,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
+@@ -4078,7 +4078,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
+@@ -4369,7 +4369,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
+@@ -4467,7 +4467,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
+@@ -4481,7 +4481,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 524288
+@@ -4495,7 +4495,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
+@@ -4509,7 +4509,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
+@@ -4694,7 +4694,7 @@
+ VARIABLE_TYPE BIGINT UNSIGNED
+ VARIABLE_COMMENT If an internal in-memory temporary table exceeds this size, MySQL 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
+@@ -4705,7 +4705,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
+@@ -4719,7 +4719,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
+@@ -4817,7 +4817,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
+@@ -4921,7 +4921,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
+@@ -4934,7 +4934,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
+@@ -4944,7 +4944,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
+@@ -5029,7 +5029,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..26e67fc2fdb
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result
@@ -0,0 +1,5065 @@
+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 autocommit
+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 MySQL 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 Allow big result sets by saving all temporary sets on file (Solves most 'table full' errors)
+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 NULL
+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 Type of DELAY_KEY_WRITE
+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 foreign_key_checks
+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 have_compress
+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 have_crypt
+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 have_dynamic_loading
+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 have_geometry
+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 have_profiling
+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 have_query_cache
+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 have_rtree_keys
+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 have_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 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_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_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_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 SELECT query that have 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 NULL
+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
+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
+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
+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,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 profiling
+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 Limit of query profiling memory
+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 MySQL 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 skip_replication
+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 sql_auto_is_null
+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 sql_big_selects
+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 sql_buffer_result
+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 Controls whether logging to the binary log is done
+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 sql_log_off
+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 sql_notes
+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 sql_quote_show_create
+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 sql_safe_updates
+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 sql_warnings
+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 524288
+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 time_zone
+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, MySQL 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 Set default transaction access mode to read only.
+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 unique_checks
+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 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 HAVE_SYMLINK
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT have_symlink
+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
+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 version_comment
+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 version_compile_machine
+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 version_compile_os
+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..3dd9cc541c4
--- /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 NULL
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE OFF
+VARIABLE_SCOPE SESSION ONLY
+VARIABLE_TYPE BOOLEAN
+VARIABLE_COMMENT Do not reject SELECT queries even when the node is not ready.
+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 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 To use a workaround forbad autoincrement value
+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 131072
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 131072
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Max number of rows in write set
+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 WSREP_MAX_WS_SIZE
+SESSION_VALUE NULL
+GLOBAL_VALUE 1073741824
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE 1073741824
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE BIGINT UNSIGNED
+VARIABLE_COMMENT Max write set size (bytes)
+NUMERIC_MIN_VALUE 1024
+NUMERIC_MAX_VALUE 4294901759
+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 Node 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_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
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT Node 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_25.11
+GLOBAL_VALUE_ORIGIN COMPILE-TIME
+DEFAULT_VALUE NULL
+VARIABLE_SCOPE GLOBAL
+VARIABLE_TYPE VARCHAR
+VARIABLE_COMMENT wsrep patch 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 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 provider specific 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 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 MySQL 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 7
+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..d940ed69901 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 ;
@@ -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/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/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..52fede2f538
--- /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
+1
+
+# 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
+1
+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..d2a62d6136f
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_dirty_reads_basic.result
@@ -0,0 +1,35 @@
+#
+# wsrep_dirty_reads
+#
+# save the initial value
+SET @wsrep_dirty_reads_session_saved = @@session.wsrep_dirty_reads;
+# default
+SELECT @@global.wsrep_dirty_reads;
+ERROR HY000: Variable 'wsrep_dirty_reads' is a SESSION variable
+SELECT @@session.wsrep_dirty_reads;
+@@session.wsrep_dirty_reads
+0
+
+# scope and valid values
+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
+
+# 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'
+
+# 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..15438a2afd5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_max_ws_rows_basic.result
@@ -0,0 +1,53 @@
+#
+# 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
+131072
+
+# 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;
+Warnings:
+Warning 1292 Truncated incorrect wsrep_max_ws_rows value: '0'
+SELECT @@global.wsrep_max_ws_rows;
+@@global.wsrep_max_ws_rows
+1
+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..26d8d823a5c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_max_ws_size_basic.result
@@ -0,0 +1,58 @@
+#
+# wsrep_max_ws_size
+#
+# save the initial value
+SET @wsrep_max_ws_size_global_saved = @@global.wsrep_max_ws_size;
+# default
+SELECT @@global.wsrep_max_ws_size;
+@@global.wsrep_max_ws_size
+1073741824
+
+# 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;
+Warnings:
+Warning 1292 Truncated incorrect wsrep_max_ws_size value: '1'
+SELECT @@global.wsrep_max_ws_size;
+@@global.wsrep_max_ws_size
+1024
+
+# valid values
+SET @@global.wsrep_max_ws_size=1073741824;
+SELECT @@global.wsrep_max_ws_size;
+@@global.wsrep_max_ws_size
+1073741824
+SET @@global.wsrep_max_ws_size=1073741825;
+SELECT @@global.wsrep_max_ws_size;
+@@global.wsrep_max_ws_size
+1073741825
+SET @@global.wsrep_max_ws_size=0;
+Warnings:
+Warning 1292 Truncated incorrect wsrep_max_ws_size value: '0'
+SELECT @@global.wsrep_max_ws_size;
+@@global.wsrep_max_ws_size
+1024
+SET @@global.wsrep_max_ws_size=default;
+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;
+Warnings:
+Warning 1292 Truncated incorrect wsrep_max_ws_size value: '-1'
+SELECT @global.wsrep_max_ws_size;
+@global.wsrep_max_ws_size
+NULL
+
+# restore the initial value
+SET @@global.wsrep_max_ws_size = @wsrep_max_ws_size_global_saved;
+# 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..9657e6bf428
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_node_name_basic.result
@@ -0,0 +1,48 @@
+#
+# 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
+SELECT @@global.wsrep_node_name;
+@@global.wsrep_node_name
+
+
+# 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;
+SELECT @@global.wsrep_node_name;
+@@global.wsrep_node_name
+
+
+# invalid values
+SET @@global.wsrep_node_name=NULL;
+ERROR 42000: Variable 'wsrep_node_name' can't be set to the value of 'NULL'
+SELECT @@global.wsrep_node_name;
+@@global.wsrep_node_name
+
+SET @@global.wsrep_node_name=1;
+ERROR 42000: Incorrect argument type to variable 'wsrep_node_name'
+SELECT @@global.wsrep_node_name;
+@@global.wsrep_node_name
+
+
+# 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..5ef36180de5
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_provider_options_basic.result
@@ -0,0 +1,48 @@
+#
+# wsrep_provider_options
+#
+call mtr.add_suppression("WSREP: Failed to get provider options");
+# 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..1e7b9364570
--- /dev/null
+++ b/mysql-test/suite/sys_vars/r/wsrep_sync_wait_basic.result
@@ -0,0 +1,56 @@
+#
+# 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;
+Warnings:
+Warning 1292 Truncated incorrect wsrep_sync_wait value: '8'
+SELECT @@session.wsrep_sync_wait;
+@@session.wsrep_sync_wait
+7
+
+# 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/mutex_deadlock_detector_basic.test b/mysql-test/suite/sys_vars/t/debug_mutex_deadlock_detector_basic.test
index 398636fcb13..12b29a309bb 100644
--- a/mysql-test/suite/sys_vars/t/mutex_deadlock_detector_basic.test
+++ b/mysql-test/suite/sys_vars/t/debug_mutex_deadlock_detector_basic.test
@@ -5,19 +5,19 @@
#
# show the global and session values;
#
-select @@global.mutex_deadlock_detector;
+select @@global.debug_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';
+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 mutex_deadlock_detector=1;
+set global debug_mutex_deadlock_detector=1;
--error ER_INCORRECT_GLOBAL_LOCAL_VAR
-set session mutex_deadlock_detector=1;
+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/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_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_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_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/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/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..bd8442b6a44
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sysvars_innodb.test
@@ -0,0 +1,14 @@
+--source include/have_innodb.inc
+--source include/have_debug.inc
+--source include/not_valgrind.inc
+--source include/word_size.inc
+
+--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..32af7d3a5ca
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/sysvars_wsrep.test
@@ -0,0 +1,10 @@
+--source include/have_wsrep.inc
+--source include/word_size.inc
+--let $datadir = `SELECT @@datadir`
+
+--replace_result $datadir DATADIR
+--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/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/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..a47524fcfe3
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_dirty_reads_basic.test
@@ -0,0 +1,35 @@
+--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
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@global.wsrep_dirty_reads;
+SELECT @@session.wsrep_dirty_reads;
+
+--echo
+--echo # scope and valid values
+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 # 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';
+
+--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..e7af4558f24
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_max_ws_size_basic.test
@@ -0,0 +1,45 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_max_ws_size
+--echo #
+
+--echo # save the initial value
+SET @wsrep_max_ws_size_global_saved = @@global.wsrep_max_ws_size;
+
+--echo # default
+SELECT @@global.wsrep_max_ws_size;
+
+--echo
+--echo # scope
+--error ER_INCORRECT_GLOBAL_LOCAL_VAR
+SELECT @@session.wsrep_max_ws_size;
+SET @@global.wsrep_max_ws_size=1;
+SELECT @@global.wsrep_max_ws_size;
+
+--echo
+--echo # valid values
+SET @@global.wsrep_max_ws_size=1073741824;
+SELECT @@global.wsrep_max_ws_size;
+SET @@global.wsrep_max_ws_size=1073741825;
+SELECT @@global.wsrep_max_ws_size;
+SET @@global.wsrep_max_ws_size=0;
+SELECT @@global.wsrep_max_ws_size;
+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;
+SET @@global.wsrep_max_ws_size=-1;
+SELECT @global.wsrep_max_ws_size;
+
+--echo
+--echo # restore the initial value
+SET @@global.wsrep_max_ws_size = @wsrep_max_ws_size_global_saved;
+
+--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..1f3ccc0de2c
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_node_name_basic.test
@@ -0,0 +1,44 @@
+--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
+SELECT @@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;
+SELECT @@global.wsrep_node_name;
+
+--echo
+--echo # invalid values
+--error ER_WRONG_VALUE_FOR_VAR
+SET @@global.wsrep_node_name=NULL;
+SELECT @@global.wsrep_node_name;
+--error ER_WRONG_TYPE_FOR_VAR
+SET @@global.wsrep_node_name=1;
+SELECT @@global.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.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..73ec4ffc846
--- /dev/null
+++ b/mysql-test/suite/sys_vars/t/wsrep_provider_options_basic.test
@@ -0,0 +1,49 @@
+--source include/have_wsrep.inc
+
+--echo #
+--echo # wsrep_provider_options
+--echo #
+
+call mtr.add_suppression("WSREP: Failed to get provider options");
+
+--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 0aaed59ed6c..451898aa972 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(*)
@@ -330,3 +330,48 @@ t1 CREATE TABLE `t1` (
`c1` varchar(50) COLLATE latin1_general_ci DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci
drop table t1;
+#
+# Start of 10.1 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_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 12f46e9b002..c78093bce0f 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;
@@ -290,3 +290,34 @@ create table t1 (a int, b int as (b is null) virtual);
create table t1 (v1 varchar(255) as (c1) persistent, c1 varchar(50)) collate=latin1_general_ci;
show create table t1;
drop table t1;
+
+
+--echo #
+--echo # Start of 10.1 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..605f063f967
--- /dev/null
+++ b/mysql-test/suite/wsrep/disabled.def
@@ -0,0 +1 @@
+foreign_key : MDEV-7915
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..38b4ada98b9
--- /dev/null
+++ b/mysql-test/suite/wsrep/include/check_galera_version.inc
@@ -0,0 +1,24 @@
+# ==== Purpose ====
+# Enable tests to check the galera library version.
+#
+# ==== Usage ====
+# --let $galera_version=25.3.6
+# source include/check_galera_lib_version.inc;
+#
+# Parameters:
+# $galera_version
+# Version of the galera library required by the test.
+#
+
+--disable_query_log
+
+eval SET @GALERA_VERSION=(SELECT CONCAT('$galera_version', '%'));
+
+if (!`SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE
+ VARIABLE_NAME LIKE 'wsrep_provider_version' AND
+ VARIABLE_VALUE LIKE @GALERA_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..d996371c056
--- /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 InnoDB transaction ID");
+#
+# 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_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/suite.pm b/mysql-test/suite/wsrep/suite.pm
new file mode 100644
index 00000000000..a7939c2e333
--- /dev/null
+++ b/mysql-test/suite/wsrep/suite.pm
@@ -0,0 +1,38 @@
+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: option --wsrep-causal-reads is deprecated),
+ qr(WSREP: --wsrep-causal-reads=ON takes precedence over --wsrep-sync-wait=0),
+ 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..a2dc8542322
--- /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 InnoDB transaction ID");
+
+--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_6832.opt b/mysql-test/suite/wsrep/t/mdev_6832.opt
new file mode 100644
index 00000000000..459a9702707
--- /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 --wsrep_causal_reads=ON
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..459a9702707
--- /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 --wsrep_causal_reads=ON
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..d77dc4e66f9
--- /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=3.9
+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/t/alter_table.test b/mysql-test/t/alter_table.test
index 05d915ec478..df4958bd2bc 100644
--- a/mysql-test/t/alter_table.test
+++ b/mysql-test/t/alter_table.test
@@ -1712,3 +1712,25 @@ CREATE TABLE t1 (
ALTER TABLE t1 ADD PRIMARY KEY IF NOT EXISTS event_id (event_id,market_id);
DROP TABLE t1;
+--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 # Start of 10.1 tests
+--echo #
+
+--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;
+
diff --git a/mysql-test/t/alter_table_online.test b/mysql-test/t/alter_table_online.test
index a160abc8fe2..6386a1551e1 100644
--- a/mysql-test/t/alter_table_online.test
+++ b/mysql-test/t/alter_table_online.test
@@ -101,3 +101,170 @@ create table t3 (a int not null primary key, b int, c varchar(80)) engine=merge
--error ER_ALTER_OPERATION_NOT_SUPPORTED
alter online table t3 union=(t1,t2);
drop table t1,t2,t3;
+
+--echo #
+--echo # MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB
+--echo #
+#
+# ALTER to the same [VAR]BINARY type
+#
+CREATE TABLE t1 (a BINARY(10));
+ALTER TABLE t1 MODIFY a BINARY(10), ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a VARBINARY(10));
+ALTER TABLE t1 MODIFY a VARBINARY(10), ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+#
+# ALTER to the same BLOB variant
+#
+CREATE TABLE t1 (a TINYBLOB);
+ALTER TABLE t1 MODIFY a TINYBLOB, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a MEDIUMBLOB);
+ALTER TABLE t1 MODIFY a MEDIUMBLOB, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a BLOB);
+ALTER TABLE t1 MODIFY a BLOB, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a LONGBLOB);
+ALTER TABLE t1 MODIFY a LONGBLOB, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+#
+# ALTER to the same [VAR]CHAR type
+#
+CREATE TABLE t1 (a CHAR(10));
+ALTER TABLE t1 MODIFY a CHAR(10), ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a VARCHAR(10));
+ALTER TABLE t1 MODIFY a VARCHAR(10), ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+
+#
+# ALTER to the same TEXT variant
+#
+CREATE TABLE t1 (a TINYTEXT);
+ALTER TABLE t1 MODIFY a TINYTEXT, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a MEDIUMTEXT);
+ALTER TABLE t1 MODIFY a MEDIUMTEXT, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TEXT);
+ALTER TABLE t1 MODIFY a TEXT, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a LONGTEXT);
+ALTER TABLE t1 MODIFY a LONGTEXT, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+#
+# ALTER from a non-binary to a binary collation
+#
+CREATE TABLE t1 (a CHAR(10));
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_bin, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a VARCHAR(10));
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_bin, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TINYTEXT);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a MEDIUMTEXT);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TEXT);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a LONGTEXT);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_bin, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+#
+# ALTER from a binary to a non-binary collation
+#
+CREATE TABLE t1 (a CHAR(10) COLLATE latin1_bin);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a VARCHAR(10) COLLATE latin1_bin);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TINYTEXT COLLATE latin1_bin);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a MEDIUMTEXT COLLATE latin1_bin);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TEXT COLLATE latin1_bin);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a LONGTEXT COLLATE latin1_bin);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+#
+# ALTER from a non-binary collation to another non-binary collation
+#
+CREATE TABLE t1 (a CHAR(10) COLLATE latin1_general_ci);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a CHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a VARCHAR(10) COLLATE latin1_general_ci);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a VARCHAR(10) COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TINYTEXT COLLATE latin1_general_ci);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a TINYTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a MEDIUMTEXT COLLATE latin1_general_ci);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a MEDIUMTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a TEXT COLLATE latin1_general_ci);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a TEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a LONGTEXT COLLATE latin1_general_ci);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+--echo #
+--echo # End of MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB
+--echo #
diff --git a/mysql-test/t/analyze_format_json.test b/mysql-test/t/analyze_format_json.test
new file mode 100644
index 00000000000..807e02d2334
--- /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
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+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;
+
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+analyze
+select * from t0, t1 where t1.a=t0.a and t0.a > 9;
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+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;
+
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+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;
+
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+analyze format=json
+select * from t1 tbl1, t1 tbl2 where tbl1.b<20 and tbl2.b<60;
+
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+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);
+
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+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();
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+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;
+
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+analyze format=json
+update t1 set b=pk;
+
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+analyze format=json
+select * from t1 where pk < 10 and b > 4;
+
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+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;
+
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+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;
+
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+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
+--replace_regex /"(r_total_time_ms|r_buffer_size)": .*?,/"volatile parameter": "REPLACED",/
+analyze format=json select a, max(b) as TOP from t2 group by a having TOP > a;
+--echo # HAVING is always TRUE (not printed)
+--replace_regex /"(r_total_time_ms|r_buffer_size)": .*?,/"volatile parameter": "REPLACED",/
+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)
+--replace_regex /"(r_total_time_ms|r_buffer_size)": .*?,/"volatile parameter": "REPLACED",/
+analyze format=json select a, max(b) as TOP from t2 group by a having 1=2;
+--echo # HAVING is absent
+--replace_regex /"(r_total_time_ms|r_buffer_size)": .*?,/"volatile parameter": "REPLACED",/
+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);
+
+--replace_regex /"(r_total_time_ms|r_buffer_size)": .*?,/"volatile parameter": "REPLACED",/
+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);
+
+--replace_regex /"(r_total_time_ms|r_buffer_size)": .*?,/"volatile parameter": "REPLACED",/
+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..a40f34805d1
--- /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;
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+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;
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+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;
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/ /"r_buffer_size": "[^"]+"/"r_buffer_size": "REPLACED"/
+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;
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+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;
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/ /"r_buffer_size": "[^"]+"/"r_buffer_size": "REPLACED"/
+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;
+
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/ /"r_buffer_size": "[^"]+"/"r_buffer_size": "REPLACED"/
+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;
+
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/ /"r_buffer_size": "[^"]+"/"r_buffer_size": "REPLACED"/
+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.
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/ /"r_buffer_size": "[^"]+"/"r_buffer_size": "REPLACED"/
+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;
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/ /"r_buffer_size": "[^"]+"/"r_buffer_size": "REPLACED"/
+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..7346ac3b2c5
--- /dev/null
+++ b/mysql-test/t/analyze_stmt_slow_query_log.test
@@ -0,0 +1,23 @@
+--disable_warnings
+drop table if exists t1;
+--enable_warnings
+
+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 97376eb7412..840b9a12cee 100644
--- a/mysql-test/t/bootstrap.test
+++ b/mysql-test/t/bootstrap.test
@@ -78,6 +78,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;
EOF
diff --git a/mysql-test/t/case.test b/mysql-test/t/case.test
index f536f556780..957c4ac5c9d 100644
--- a/mysql-test/t/case.test
+++ b/mysql-test/t/case.test
@@ -193,3 +193,75 @@ insert t1 values ('00:00:00'),('00:01:00');
select case t1.f1 when '00:00:00' then 1 end from 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..58f91571ebb 100644
--- a/mysql-test/t/cast.test
+++ b/mysql-test/t/cast.test
@@ -456,3 +456,19 @@ 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));
+
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 ded9096900c..10ee41ca2aa 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..e136798ac29
--- /dev/null
+++ b/mysql-test/t/create_drop_event.test
@@ -0,0 +1,44 @@
+--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;
+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;
+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;
+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 9e37950dbef..3e37910380c 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 d44009b6109..07e73cdf745 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.
#
@@ -203,3 +203,235 @@ SET NAMES gbk;
--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 aeaad2cc026..a30c7ae9a5d 100644
--- a/mysql-test/t/ctype_latin1.test
+++ b/mysql-test/t/ctype_latin1.test
@@ -248,3 +248,131 @@ SELECT _latin1 0x7E, _latin1 X'7E', _latin1 B'01111110';
--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_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..3e5fa873e9b 100644
--- a/mysql-test/t/ctype_uca.test
+++ b/mysql-test/t/ctype_uca.test
@@ -620,3 +620,29 @@ 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;
+
+--echo #
+--echo # End of MariaDB-10.1 tests
+--echo #
diff --git a/mysql-test/t/ctype_ucs.test b/mysql-test/t/ctype_ucs.test
index 33d41e9bc4c..2f480621c56 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
@@ -880,7 +885,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;
@@ -914,7 +919,41 @@ SELECT CONCAT(CONVERT('pi=' USING ucs2),PI()) AS PI;
SET NAMES utf8, character_set_connection=ucs2;
SELECT 'a','aa';
-
--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_utf16.test b/mysql-test/t/ctype_utf16.test
index e4305ed9879..bb7eb8cd959 100644
--- a/mysql-test/t/ctype_utf16.test
+++ b/mysql-test/t/ctype_utf16.test
@@ -860,3 +860,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_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 e6583f990ca..4bff8a867f1 100644
--- a/mysql-test/t/ctype_utf32.test
+++ b/mysql-test/t/ctype_utf32.test
@@ -956,3 +956,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_utf8.test b/mysql-test/t/ctype_utf8.test
index 2f34e47823b..115b059efef 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);
@@ -1818,3 +1819,58 @@ let $ctype_unescape_combinations=selected;
--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 # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/ctype_utf8mb4.test b/mysql-test/t/ctype_utf8mb4.test
index d59c6d397fc..3f2b6000597 100644
--- a/mysql-test/t/ctype_utf8mb4.test
+++ b/mysql-test/t/ctype_utf8mb4.test
@@ -1844,7 +1844,66 @@ set @@collation_connection=utf8mb4_bin;
--echo # End of 5.6 tests
--echo #
+--echo #
+--echo # Start of 10.0 tests
+--echo #
+
+--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 # End of 10.0 tests
+--echo #
--echo #
--echo # End of 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 # 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 b719cb83448..17f4383ae22 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;
@@ -166,3 +168,18 @@ drop table t1, t2;
--echo End of 5.0 tests.
+--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/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/derived.test b/mysql-test/t/derived.test
index a7739dcf8a7..c78613e4304 100644
--- a/mysql-test/t/derived.test
+++ b/mysql-test/t/derived.test
@@ -829,3 +829,37 @@ ORDER BY TOTAL DESC;
DROP TABLES t1,t2;
set optimizer_switch=@save_derived_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));
+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 67899837bb2..3d9ab4e4477 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/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/engine_error_in_alter-8453.test b/mysql-test/t/engine_error_in_alter-8453.test
new file mode 100644
index 00000000000..c4600ec07fe
--- /dev/null
+++ b/mysql-test/t/engine_error_in_alter-8453.test
@@ -0,0 +1,11 @@
+#
+# MDEV-8453 Alter table not returning engine errors
+#
+--source include/have_debug.inc
+
+create table t1 (a int, b int);
+set debug_dbug='+d,external_lock_failure';
+--error ER_GET_ERRMSG
+alter table t1 add column c int;
+set debug_dbug='';
+drop table t1;
diff --git a/mysql-test/t/events_1.test b/mysql-test/t/events_1.test
index bf5a356cee3..88120b0cd4f 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 3d609654b21..7d9ac7c5858 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
@@ -13,7 +15,7 @@ use events_test;
# mysql.event intact checking end
#
-create event e_26 on schedule at '2017-01-01 00:00:00' disable do set @a = 5;
+create event e_26 on schedule at '2027-01-01 00:00:00' disable do set @a = 5;
select db, name, body, definer, convert_tz(execute_at, 'UTC', 'SYSTEM'), on_completion from mysql.event;
drop event e_26;
--error ER_WRONG_VALUE
diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test
index 5b5123ad295..df40b840a68 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..153d85359c9
--- /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;
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+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;
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+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;
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+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;
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+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);
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+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..f3567797019
--- /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);
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+analyze format=json select * from t1 where a in (2,3,4);
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+analyze format=json update t1 set a=a+10 where a in (2,3,4);
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+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..2a06769b2ef 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,9 @@ 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 #
diff --git a/mysql-test/t/func_encrypt.test b/mysql-test/t/func_encrypt.test
index 18fb072966b..4eab0ac87e9 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_group.test b/mysql-test/t/func_group.test
index bd3ed4ad32d..b5270743465 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -1565,3 +1565,49 @@ EXECUTE stmt;
EXECUTE stmt;
DROP TABLE t1,t2,t3,t4,t5,t6;
+
+--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-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 # 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..047e5f7b72e
--- /dev/null
+++ b/mysql-test/t/func_hybrid_type.test
@@ -0,0 +1,438 @@
+--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 # 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 1e695142d90..fab39b04484 100644
--- a/mysql-test/t/func_in.test
+++ b/mysql-test/t/func_in.test
@@ -606,3 +606,16 @@ EXECUTE s;
DROP TABLE t1;
--echo # End of 5.3 tests
+
+--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 2998742dbcc..b48f4599074 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 26e379299fc..47afb6664a5 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;
@@ -1067,6 +1067,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_str.test b/mysql-test/t/func_str.test
index 6369609bea3..2645417f3e5 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,7 +1748,41 @@ EXECUTE stmt;
SET NAMES latin2;
EXECUTE stmt;
+disconnect conn1;
+connection default;
+set global max_allowed_packet=default;
--echo #
--echo # End of 5.6 tests
--echo #
+
+--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;
+
+--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 f2c53bd5ece..18293f31dd2 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
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-alter_table_online.test b/mysql-test/t/gis-alter_table_online.test
new file mode 100644
index 00000000000..be6d2137e77
--- /dev/null
+++ b/mysql-test/t/gis-alter_table_online.test
@@ -0,0 +1,82 @@
+--source include/have_innodb.inc
+--source include/have_geometry.inc
+
+--echo #
+--echo # Start of 10.1 tests
+--echo #
+
+--echo #
+--echo # MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB
+--echo #
+
+#
+# Blob variants to GEOMETRY
+#
+CREATE TABLE t1 (a TINYBLOB);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a GEOMETRY, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a MEDIUMBLOB);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a GEOMETRY, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a BLOB);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a GEOMETRY, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a LONGBLOB);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a GEOMETRY, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+#
+# GEOMETRY to BLOB variants
+#
+
+CREATE TABLE t1 (a GEOMETRY);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a TINYBLOB, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a GEOMETRY);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a MEDIUMBLOB, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a GEOMETRY);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a BLOB, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+CREATE TABLE t1 (a GEOMETRY);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a LONGBLOB, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+#
+# Different GEOMETRY types
+#
+
+# Can't do INPLACE from a supertype to a subtype
+CREATE TABLE t1 (a GEOMETRY);
+--error ER_ALTER_OPERATION_NOT_SUPPORTED
+ALTER TABLE t1 MODIFY a POLYGON, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+# Ok to do INPLACE from a subtype to a supertype
+CREATE TABLE t1 (a POLYGON);
+ALTER TABLE t1 MODIFY a GEOMETRY, ALGORITHM=INPLACE;
+DROP TABLE t1;
+
+# Ok to do INPLACE for two equal geometry subtypes
+CREATE TABLE t1 (a POLYGON);
+ALTER TABLE t1 MODIFY a POLYGON, ALGORITHM=INPLACE;
+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..5e57569a912 100644
--- a/mysql-test/t/gis-precise.test
+++ b/mysql-test/t/gis-precise.test
@@ -357,5 +357,10 @@ 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)'));
+
--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 9378ea55377..18cfe95b749 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 #
@@ -1491,4 +1453,75 @@ SHOW CREATE VIEW v1;
SELECT ASTEXT(p) FROM v1;
DROP VIEW v1;
-# --echo End of 5.5 tests
+--echo End of 5.5 tests
+
+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;
+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 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 548fd0f810e..1d828cd8693 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
@@ -2208,9 +2210,6 @@ disconnect con1;
DROP USER untrusted@localhost;
DROP DATABASE secret;
-# Wait till we reached the initial number of concurrent sessions
---source include/wait_until_count_sessions.inc
-
--echo #
--echo # BUG#11759114 - '51401: GRANT TREATS NONEXISTENT FUNCTIONS/PRIVILEGES
--echo # DIFFERENTLY'.
@@ -2233,3 +2232,7 @@ grant select on mysqltest_db1.t1 to mysqltest_u1;
show grants for mysqltest_u1;
drop database mysqltest_db1;
drop user mysqltest_u1;
+
+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 4b992faa306..531cec6b730 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;
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/help.test b/mysql-test/t/help.test
index 71821e46771..43e61136e05 100644
--- a/mysql-test/t/help.test
+++ b/mysql-test/t/help.test
@@ -63,12 +63,14 @@ help 'impossible_function_1';
help 'impossible_category_1';
##############
+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 b2e18097c65..f1e78441852 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,4 @@ disconnect con1;
# Wait till all disconnects are completed
--source include/wait_until_count_sessions.inc
+set global sql_mode=default;
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_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 ff8396fd7fd..2d95dffa17a 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/join_cache.test b/mysql-test/t/join_cache.test
index 7d873c555f6..019d8edde2f 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 19c5f64de78..9ae65780086 100644
--- a/mysql-test/t/join_outer.test
+++ b/mysql-test/t/join_outer.test
@@ -1800,5 +1800,28 @@ 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;
SET optimizer_switch=@save_optimizer_switch;
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/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/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_innodb-master.sh b/mysql-test/t/lowercase_mixed_tmpdir_innodb-master.sh
index 95c26e3aa02..95c26e3aa02 100644..100755
--- a/mysql-test/t/lowercase_mixed_tmpdir_innodb-master.sh
+++ b/mysql-test/t/lowercase_mixed_tmpdir_innodb-master.sh
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/merge.test b/mysql-test/t/merge.test
index 2697e3b9a5f..5bfe22697dd 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 c013938416e..d54c2ab7c55 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 2b4b1e69ab6..f1813dd0ca4 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;
@@ -608,5 +610,30 @@ 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_upgrade.test b/mysql-test/t/mysql_upgrade.test
index 2ef469ba7c5..9d33dd70e3a 100644
--- a/mysql-test/t/mysql_upgrade.test
+++ b/mysql-test/t/mysql_upgrade.test
@@ -2,6 +2,8 @@
-- source include/have_working_dns.inc
-- source include/have_innodb.inc
+set sql_mode="";
+
#
# Basic test that we can run mysql_upgrde and that it finds the
# expected binaries it uses.
@@ -166,4 +168,28 @@ SELECT grantor FROM mysql.tables_priv WHERE db = 'mysql' AND table_name = 'user'
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;
+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 tests
diff --git a/mysql-test/t/mysql_upgrade_view.test b/mysql-test/t/mysql_upgrade_view.test
index c98c88f840e..7afe1ad250d 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;
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 b778a1deb9b..e5bc36f6851 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_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 fabc2e21f18..2ddb58e6de4 100644
--- a/mysql-test/t/mysqld--help.test
+++ b/mysql-test/t/mysqld--help.test
@@ -22,15 +22,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
- version.*/;
+ 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/;
# And substitute the content some environment variables with their
# names:
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 8a9fd4ba91d..e5ae109088c 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;
#
# MDEV-6091 mysqldump goes in a loop and segfaults if --dump-slave is specified and it cannot connect to the server
@@ -2497,7 +2499,6 @@ DROP DATABASE db_20772273;
--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 #
@@ -2512,3 +2513,58 @@ if (`select convert(@@version_compile_os using latin1) IN ("Win32","Win64","Wind
}
--exec $MYSQL_DUMP --routines --compact $shell_ready_db_name
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;
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..8857195d0e1 100644
--- a/mysql-test/t/null.test
+++ b/mysql-test/t/null.test
@@ -308,3 +308,656 @@ 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;
+
+--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..0572570d122 100644
--- a/mysql-test/t/old-mode.test
+++ b/mysql-test/t/old-mode.test
@@ -68,8 +68,18 @@ 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;
+
diff --git a/mysql-test/t/openssl_1.test b/mysql-test/t/openssl_1.test
index e36f106a5be..8c81bdc9bbb 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;
@@ -263,6 +265,7 @@ disconnect con1;
connection default;
DROP USER bug42158@localhost;
+set global sql_mode=default;
--echo End of 5.1 tests
# Wait till we reached the initial number of concurrent sessions
diff --git a/mysql-test/t/openssl_6975.test b/mysql-test/t/openssl_6975.test
index bc6397c5c28..88fe17d0621 100644
--- a/mysql-test/t/openssl_6975.test
+++ b/mysql-test/t/openssl_6975.test
@@ -7,7 +7,9 @@ source include/have_ssl_communication.inc;
# this is OpenSSL test.
+create user ssl_sslv3@localhost;
grant select on test.* to ssl_sslv3@localhost require cipher "RC4-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;
diff --git a/mysql-test/t/order_by.test b/mysql-test/t/order_by.test
index cf6a4d473c3..bdd6f3b825f 100644
--- a/mysql-test/t/order_by.test
+++ b/mysql-test/t/order_by.test
@@ -1958,3 +1958,42 @@ 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;
+
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 f59a5d01cf5..0a19b03a4eb 100644
--- a/mysql-test/t/parser.test
+++ b/mysql-test/t/parser.test
@@ -758,3 +758,266 @@ CREATE TABLE t1 (s VARCHAR(100));
CREATE TRIGGER trigger1 BEFORE INSERT ON t1 FOR EACH ROW
SET default_storage_engine = NEW.INNODB;
DROP TABLE t1;
+
+--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 754677e9b37..d3161c9338c 100644
--- a/mysql-test/t/partition.test
+++ b/mysql-test/t/partition.test
@@ -2884,3 +2884,17 @@ alter table t1 drop partition if exists p5;
DROP TABLE t1;
+--echo #
+--echo # Start of 10.1 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_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_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 6845cca10fb..d7f683aa9e9 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/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..c5d96e0d612 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
@@ -580,4 +583,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 c45b27281a7..3881d522bbf 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 22cad56a8e4..5fedc787e01 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/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 854af85f3fb..5eba778cf9e 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 5c6dfdc9dd1..ba4928faffb 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -1757,3 +1757,65 @@ 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 # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/read_only.test b/mysql-test/t/read_only.test
index 8ea0f2db9b7..3e5d4fc8ce1 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
@@ -274,6 +278,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`@`%`;
@@ -360,4 +365,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 bad65a4175a..58cc810b1a9 100644
--- a/mysql-test/t/repair_symlink-5543.test
+++ b/mysql-test/t/repair_symlink-5543.test
@@ -22,5 +22,4 @@ 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..9268a3e1086 100644
--- a/mysql-test/t/row.test
+++ b/mysql-test/t/row.test
@@ -285,3 +285,21 @@ 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 # 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 c46ff69295f..92e38604a30 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/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_statement.test b/mysql-test/t/set_statement.test
new file mode 100644
index 00000000000..5d6206335fb
--- /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;
+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;
+--echo #---
+--echo #should be written
+set statement long_query_time=0.01 for select sleep(0.1);
+select sql_text from mysql.slow_log;
+--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;
+--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;
+--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;
+--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;
+--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/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 c62257049ee..9e6b919ea19 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
@@ -9371,3 +9367,89 @@ drop procedure p1;
drop table t1,t2,t3,t4,t5,t6;
+--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;
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/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_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..3b57b8f2c52 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;
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/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 45c4fe920b7..7a7c01e78bd 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));
@@ -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
diff --git a/mysql-test/t/subselect_cache.test b/mysql-test/t/subselect_cache.test
index 1276e546030..21247541fb6 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%';
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+analyze format=json
+select a, (select d from t2 where b=c) from t1;
+--replace_regex /"r_total_time_ms": [0-9]*[.]?[0-9]*/"r_total_time_ms": "REPLACED"/
+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_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 b26d5a71e46..b6d6e0a5172 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/symlink.test b/mysql-test/t/symlink.test
index 20585dd9ab7..065be302237 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.
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 24f48206013..52857f9169f 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 f594f0c6c48..987fbf7e848 100644
--- a/mysql-test/t/temp_table.test
+++ b/mysql-test/t/temp_table.test
@@ -319,3 +319,22 @@ INSERT INTO t3 VALUES (101), (102), (103);
REPAIR TABLE t1, t2, t3;
DROP TABLES t1, t2, t3;
+
+#
+# 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..a02dce34837 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,25 @@ 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;
+
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..c9b0257afc8
--- /dev/null
+++ b/mysql-test/t/trigger_null-8605.test
@@ -0,0 +1,362 @@
+#
+# 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);
+select * from t1;
+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;
diff --git a/mysql-test/t/type_date.test b/mysql-test/t/type_date.test
index c01adc1b233..52ca2c85b15 100644
--- a/mysql-test/t/type_date.test
+++ b/mysql-test/t/type_date.test
@@ -392,3 +392,169 @@ 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 # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/type_datetime.test b/mysql-test/t/type_datetime.test
index e44b190def0..444ab02d223 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');
@@ -613,3 +613,85 @@ DROP TABLE t1,t2;
--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..86066309acc 100644
--- a/mysql-test/t/type_newdecimal.test
+++ b/mysql-test/t/type_newdecimal.test
@@ -1622,3 +1622,68 @@ 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 # End of 10.1 tests
+--echo #
diff --git a/mysql-test/t/type_num.test b/mysql-test/t/type_num.test
new file mode 100644
index 00000000000..6ed04c8e1d3
--- /dev/null
+++ b/mysql-test/t/type_num.test
@@ -0,0 +1,683 @@
+--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 #
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_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 195252a2df9..6188ed6b4d6 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;
@@ -520,3 +520,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 528d26d6f86..cc09069508f 100644
--- a/mysql-test/t/type_varchar.test
+++ b/mysql-test/t/type_varchar.test
@@ -240,6 +240,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 9204ddd22e5..f2026a67bc2 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;
@@ -1086,13 +1121,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);
@@ -1350,3 +1384,106 @@ UNION
;
drop table t1;
+
+--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/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/status_user.test b/mysql-test/t/userstat.test
index 9a51d0e1020..cb1250a13ea 100644
--- a/mysql-test/t/status_user.test
+++ b/mysql-test/t/userstat.test
@@ -33,6 +33,12 @@ select * from t1 where a=999;
drop table t1;
+# test SSL connections
+--connect (ssl_con,localhost,root,,,,,SSL)
+--replace_result DHE-RSA-AES256-GCM-SHA384 DHE-RSA-AES256-SHA
+SHOW STATUS LIKE 'Ssl_cipher';
+--connection default
+
#
# Test the commit and rollback are counted
#
@@ -55,6 +61,8 @@ 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;
@@ -66,13 +74,13 @@ 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;
+--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 "%statistics%";
+show status like "%generic%";
#
# Test that some variables are not 0
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 b962903d0dc..3132b99b2b7 100644
--- a/mysql-test/t/view.test
+++ b/mysql-test/t/view.test
@@ -2083,18 +2083,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;
@@ -2806,11 +2804,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';
@@ -2840,6 +2839,8 @@ USE test;
disconnect root;
disconnect user21261;
+set GLOBAL sql_mode=default;
+set LOCAL sql_mode=default;
#
# Bug#15950 NOW() optimized away in VIEWs
@@ -4317,13 +4318,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;
@@ -5683,3 +5694,60 @@ SELECT 1 FROM (SELECT 1 as a) AS b HAVING (SELECT `SOME_GARBAGE`.b.a)=1;
--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 # 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 371fcb72b0d..3e7c9b78673 100644
--- a/mysql-test/t/xml.test
+++ b/mysql-test/t/xml.test
@@ -674,7 +674,9 @@ SELECT ExtractValue('<a><b>xxx</c></a>','/a/b');
--echo # Bug#58175 xml functions read initialized bytes when conversions happen
--echo #
SET NAMES latin1;
+--enable_prepare_warnings
SELECT UPDATEXML(CONVERT('' USING swe7), TRUNCATE('',1), 0);
+--disable_prepare_warnings
--echo #
--echo # Bug#12375190: UPDATEXML CRASHES ON SIMPLE INPUTS
diff --git a/mysql-test/valgrind.supp b/mysql-test/valgrind.supp
index e8eb47eb1cb..9c10c647514 100644
--- a/mysql-test/valgrind.supp
+++ b/mysql-test/valgrind.supp
@@ -127,6 +127,15 @@
}
{
+ pthread memalign memory loss3
+ Memcheck:Leak
+ fun:memalign
+ fun:tls_get_addr_tail
+ ...
+ fun:*ha_finalize_handlerton*
+}
+
+{
pthread pthread_key_create
Memcheck:Leak
fun:malloc
@@ -420,7 +429,7 @@
Memcheck:Leak
fun:memalign
...
- fun:call_init
+ fun:call_init*
fun:_dl_init
}
@@ -635,21 +644,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)
#
@@ -1282,3 +1276,375 @@
fun:_dlerror_run
fun:dlopen@@GLIBC_2.2.5
}
+
+{
+ vasprintf in OpenSuse 12.3
+ Memcheck:Leak
+ fun:malloc
+ fun:vasprintf
+ fun:asprintf
+ fun:dlerror
+}
+
+{
+ GitHub codership/galera#308
+ Memcheck:Leak
+ match-leak-kinds: definite
+ 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
+}
+
+{
+ GitHub codership/mysql-wsrep#176
+ Memcheck:Leak
+ fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
+ fun:galera_parameters_get
+ fun:_ZL24refresh_provider_optionsv
+ 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
+}
+
+{
+ 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
+}
+
+{
+g codership/mysql-wsrep/issues#176
+ Memcheck:Leak
+ fun:_Z16wsrep_set_paramsRN6galera10ReplicatorEPKc
+}
+
+{
+ codership/mysql-wsrep/issues#176
+ Memcheck:Leak
+ fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
+}
+
+{
+ codership/mysql-wsrep/issues#176
+ Memcheck:Leak
+ fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
+ fun:galera_parameters_get
+ fun:_ZL24refresh_provider_optionsv
+ fun:_Z21wsrep_provider_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: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/mysql-wsrep/issues#176
+ Memcheck:Leak
+ match-leak-kinds: possible
+ fun:malloc
+ fun:strdup
+ fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
+ fun:galera_parameters_get
+ fun:_ZL24refresh_provider_optionsv
+ 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: definite
+ fun:malloc
+ fun:strdup
+ fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
+ fun:galera_parameters_get
+ fun:_ZL24refresh_provider_optionsv
+ 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: definite
+ fun:malloc
+ fun:strdup
+ fun:_Z16wsrep_get_paramsRKN6galera10ReplicatorE
+ fun:galera_parameters_get
+ fun:_ZL24refresh_provider_optionsv
+ fun:_Z21wsrep_provider_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/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
+}
+